jkvatne / gio-v

Widgets for gio
Other
31 stars 5 forks source link

keyboard navigation in ALL demos: Lost focus when using tabs and then selecting with spacebar #9

Open gedw99 opened 2 years ago

gedw99 commented 2 years ago

The grid demo is also close to perfect.

the tab and space is a common keyboard navigation sequence.

Here i am tabbing through from the Wide Table radio to Dark Mode checkbox, by pressing space and then trying to again press space ( to toggle dark mode ). The bug is that the Dark Mode checkbox has lost focus. The focus has moved to the first tab ( ie the Wide Table radio ).

It could be that groups are required to isolate between the first row of radio and the 2nd row of checkboxes ?

Mac https://user-images.githubusercontent.com/53147028/203529736-cb5ebbfe-bfee-4bdf-81ea-f5728ecf1c4d.mov


Web

jkvatne commented 2 years ago

I develop on a windows 11 PC, and has not tried any other platform. So I am not surprised that they do not work.

The problem with loosing focus on change to dark mode (and the other theme settings) is deeper. The reason is that when you change settings, I have to rebuild everytning from scratch. All persistent data is lost. This is a choice I have made to simplify the form building code. It does not follow the usual gio recomendations.

gedw99 commented 1 year ago

I just tried all the demos and they all have the same issue in that tabbing works, but then pressing space bar to activate what your on causes the tab to go back to the start globally.

https://github.com/jkvatne/gio-v/assets/53147028/482f0f24-254f-4704-a55c-238cf889d755


https://github.com/gioui/gio-example/tree/main/component does not have this problem and works how as expected.

Not sure why yet..

https://github.com/jkvatne/gio-v/assets/53147028/ab95605b-f1cf-46aa-83ff-3a98dccab169

jkvatne commented 1 year ago

Thanks for testing. The problem with focus jumping to the first field on the button demo is most likely due to the program functionality. When the button changes the color theme or other global settings like window size or font size, it has to re-initialize all the widgets, and that causes the focus to jump. I have not found any solution to this.