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

Bubble up key events incl. shortcuts that are not handled by PlutoGrid #1070

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdamDreessen
Copy link

PlutoGridState registers its own key handler _handleGridFocusKeyOnly via the FocusScope widget and onKeyEvent property. The registered key handler always returns KeyEventResult.handled. This prevents parent widgets to use own shortcuts because key events are not "bubbled up" in the widget hierarchy.

Pluto Grid defines its own "default actions" and "shortcuts". It is desirable that only these are prevented from "bubbling up" and all other key events are passed on to parent widgets.

With this PR we implemented this behavior in PlutoGridState._handleGridFocusOnKey.

Copy link

@KaushikGupta007 KaushikGupta007 left a comment

Choose a reason for hiding this comment

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

Will this fix back button not working issue in Android

@AdamDreessen
Copy link
Author

AdamDreessen commented Jun 18, 2024

@KaushikGupta007

Will this fix back button not working issue in Android

I cannot tell but might be worth a try. We're using it in a Win/MacOS desktop app. And without this fix we are not able to handle key events (e.g. global shortcuts on app level) outside the PlutoGrid.

@AdamDreessen
Copy link
Author

@KaushikGupta007 I just tested the sample app from your bug report: #1066
And yes, this PR here fixes it. The Android back button works.

@KaushikGupta007
Copy link

@AdamDreessen Yeah, thanks for the fix. I hope it gets merged soon.

@KaushikGupta007
Copy link

Hey @AdamDreessen,
Back button still not works on filter menu. Do you have fix for this ?
240729831-6a78d25b-d4e2-43cc-a781-77341d00cb81
Thanks

Repository owner deleted a comment from VittorioParagallo Aug 24, 2024
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