-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
[FormBuilderDateTimePicker]: onPressed of suffixIcon don't work on Windows / Web #1357
Comments
This calendar component has so many bugs |
still bug i cannot set them to null |
This issue is present in Linux build as well. Further testing revealed that a picker is erroneously shown only when the suffix button is being long pressed. A very quick tap does seem to trigger the button's onPressed callback. Digging deeping, it would seem that the issue is caused by the way a tap event is handled: flutter_form_builder/lib/src/fields/form_builder_date_time_picker.dart Lines 272 to 277 in acb7364
Instead of adding a tap listener the normal way, it would seed a focus listener is attached to the entire widget, which includes the prefix/suffix widgets. And it seems that touch events on those widgets propagate as focus events to the parent widget, causing the picker to appear. This implementation also causes another type of bug. When |
Is there an existing issue for this?
Package/Plugin version
9.2.0
Platforms
Flutter doctor
Flutter doctor
Minimal code example
Code sample
Current Behavior
I have tried to set IconButton to FormBuilderDateTimePicker.decoration.suffixIcon.
However, when I run the app on Windows and Web, when I tap the IconButton, the IconButton's onPressed is not called and the Form's tap event is called.
Same situation as #1205.
Expected Behavior
When the application is run on Windows and Web, onPressed function (like Reset) cannot be used using the IconButton.
Steps To Reproduce
Aditional information
If the application is set to run as "Android Emulator API 33 (mobile)" and Run, "onIconPressed" will be logged when the IconButton is clicked.
The same problem occurs in the official example application.
https://github.com/flutter-form-builder-ecosystem/flutter_form_builder/blob/26bba7b36e8af84e2fc9f6f2e076e47562ee8f03/example/lib/sources/complete_form.dart
example.2024-01-29.08-38-08.mp4
The text was updated successfully, but these errors were encountered: