Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fitted box option #723

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MohammedShuqair
Copy link

add a fitted box option for small input fields

@MohammedShuqair MohammedShuqair changed the title dd a fitted box option Add a fitted box option Dec 8, 2024
@@ -23,6 +23,7 @@ class DropdownSearch<T> extends BaseDropdownSearch<T> {
super.onSaved,
super.validator,
super.decoratorProps,
super.onTap,
Copy link
Owner

@salim-lachdhaf salim-lachdhaf Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not understand why you added onTap CallBack ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for a callback that is executed when the DropdownSearch is pressed, later I discovered onBeforePopupOpening so I no longer use onTap and removed it.
The reason I search for onBeforePopupOpening might be useful, I had this case:

  1. Auth Screen with CustomTextFormField (name, email etc) and DropdownSearch for country selection.
  2. Having Focus on a CustomTextFormField (keyboard shown) 👍
  3. Taping on DropdownSearch (keyboard disappeared) 👍
  4. Selecting Item From DropdownSearchPopup, popup closed 👍
  5. Focus return to last CustomTextFormField and (keyboard shown) 👎

fix:
add focusNode property for each CustomTextFormField and updating the code

Old:

  onTapOutside: (pointDown) {
              FocusScope.of(context).unfocus();
            },

New:

 onTapOutside: (pointDown) {
              focusNode!.unfocus();
            },

After all, I neither use onTap nor onBeforePopupOpening 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants