Open AdamDreessen opened 2 weeks ago
@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.
@KaushikGupta007 I just tested the sample app from your bug report: https://github.com/bosskmk/pluto_grid/issues/1066 And yes, this PR here fixes it. The Android back button works.
@AdamDreessen Yeah, thanks for the fix. I hope it gets merged soon.
PlutoGridState
registers its own key handler_handleGridFocusKeyOnly
via theFocusScope
widget andonKeyEvent
property. The registered key handler always returnsKeyEventResult.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
.