You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue in our Flutter web project while using the DropdownButtonFormField2 package. Specifically, I need the dropdown menu to automatically close when the screen size changes. Currently, this behavior is not supported by the package.
I implemented a temporary workaround using WidgetsBindingObserver to detect screen size changes and close the menu manually via Navigator.of(context).pop(). However, it would be more efficient if this feature were supported natively by the package.
I've drafted a request to raise this issue with the package maintainer and included the relevant code. If you agree, I can proceed with contacting the maintainer.
The common practice for dropdown menus in web is to remain open until the user interacts with them (e.g., by clicking outside the menu or choosing an option).
Auto closing the menu when the screen size changes can be disruptive to the user experience. Can you elaborate more why it is needed?
Thank you for your recent update. I noticed that the latest beta version of the package has resolved some of the issues I was facing with dropdown functionality. However, I would like to suggest adding a field or property that controls whether the dropdown menu should remain open or close when the web screen size changes.
This feature would provide more flexibility for developers working on responsive web applications, allowing them to manage dropdown visibility effectively without needing to implement custom listeners.
Please let me know if this is something that can be considered in future releases.
Thank you for your continuous support and efforts!
Closing dropdown menu when the screen size changes is uncommon practice and can be opinionated.
i.e: a user may want it to close just when screen size changes and another user may want it to close at some breakpoints.
another example: a user may want it to close when keyboard opens, another user doesn't (using search dropdown).
Therefore, as this is uncommon practice and can be easily done by using Navigator.of(context).pop(), I don't think it's a good idea to implement it internally.
Hi Ahmed,
I've encountered an issue in our Flutter web project while using the DropdownButtonFormField2 package. Specifically, I need the dropdown menu to automatically close when the screen size changes. Currently, this behavior is not supported by the package.
I implemented a temporary workaround using WidgetsBindingObserver to detect screen size changes and close the menu manually via Navigator.of(context).pop(). However, it would be more efficient if this feature were supported natively by the package.
I've drafted a request to raise this issue with the package maintainer and included the relevant code. If you agree, I can proceed with contacting the maintainer.
Looking forward to your feedback.
dropDownButton2_issues.txt
Thanks!
The text was updated successfully, but these errors were encountered: