AhmedLSayed9 / dropdown_button2

Flutter's core Dropdown Button widget with steady dropdown menu and many other features.
https://pub.dev/packages/dropdown_button2
MIT License
264 stars 122 forks source link

How to wrap TapRegion with groupID around DropdownButtonFormField2 to track TapInside / TapOutside with other TapRegions #294

Open lewinpauli opened 2 months ago

lewinpauli commented 2 months ago

My problem is, I have a DropdownButtonFormField2 inside a OverlayPortal and it closes if I click outside of it.

if I select a value of the dropdown its being detected as an outsideclick, probably because one widget is absorbing the onclick event.

Only one member joins the GestureArena:

flutter: Gesture arena 12   ❙ ★ Opening new gesture arena.
flutter: Gesture arena 12   ❙ Adding: TapAndPanGestureRecognizer#3962c(debugOwner: _TextSelectionGestureDetectorState#e296f)
flutter: Gesture arena 12   ❙ Closing with 1 member.
flutter: Gesture arena 12   ❙ Default winner: TapAndPanGestureRecognizer#3962c(debugOwner: _TextSelectionGestureDetectorState#e296f)

I have multiple widgets that are wrapped with TapRegion and the same groupID to handle the behaviour consistently

It would be really nice to use TapRegion with groupID here as well... if you have an Idea where to put the TapRegion or which widget is absorbing the event let me know

It looks like DropdownButtonFormField2 is also using a Overlay that doesnt overflow the screen, if you know how to realize that I would also be happy to know.