icemanbsi / searchable_dropdown

MIT License
107 stars 162 forks source link

menu not showing on flutter web with --release flag #80

Open rinde opened 4 years ago

rinde commented 4 years ago

Consider this snippet:

SearchableDropdown.single(
  dialogBox: false,
  menuConstraints: BoxConstraints.tight(Size.fromHeight(350)),
  /* rest of parameters are hidden for brevity */
),

It works as expected when running with: flutter run -d chrome

When running with: flutter run --release -d chrome the menu is not expanded when clicking on the dropdown. The mouse click does seem to register as the InkWell is displayed as well as the highlight on mouse hover. When choosing dialogBox: true the code also works as expected, this could be a good workaround if the dialogBox wasn't screen filling on web.

I've tested this on the following flutter versions (all with the same result):

I'm not sure if the problem lies with flutter itself or if it is fixable in this project.

hoonblizz commented 4 years ago

I had the same issue. It works good on debug mode but not in release mode. Thankfully dialogBox: true made it functional in release mode. (Of course it's against my UI but it works)

Aerofluxx commented 3 years ago

I can still confirm this behavior.

Build with: flutter build web --release --web-renderer canvaskit and also tried flutter build web --release --web-renderer html

As above dialogBox: true works but it's just not user friendly to push a huge screen above the whole content.

maxime915 commented 3 years ago

I can still confirm this behavior.

Same build options as @Aerofluxx . I can also confirm that changing dialogBox: true works with both renderer.

EDIT: flutter run --profile doesn't work either

lcuis commented 3 years ago

Can you please try with the search_choices plugin to know whether there is a difference between the 2 plugins on this point? So far, I never had issues with running in release mode on web, android, ios and linux.

maxime915 commented 3 years ago

Can you please try with the search_choices plugin to know whether there is a difference between the 2 plugins on this point? So far, I never had issues with running in release mode on web, android, ios and linux.

Yes it works perfectly with the search_choices plugin in release mode on web (with both flutter run and flutter build), this may solve our issue, thanks!

lcuis commented 3 years ago

Can you please try with the search_choices plugin to know whether there is a difference between the 2 plugins on this point? So far, I never had issues with running in release mode on web, android, ios and linux.

Yes it works perfectly with the search_choices plugin in release mode on web (with both flutter run and flutter build), this may solve our issue, thanks!

Thanks for letting us know @maxime915 . It would be good to understand where the discrepancy comes from and what exactly causes this failure for the searchable_dropdown that doesn’t affect search_choices.