lvgl: gridnav can't open dropdown list
Perform all steps below and tick them with [x]
- Read the FAQ
- Check the related part of the Documentation
- Update lvgl to the latest version
- Reproduce the issue in a Simulator
Describe the bug
When adding a dropdown widget to an container with gridnav you can focus the dropdown but you can’t open it to select from the values of the dropdown list. It is working when using just a group without the gridnav (by tabbing).
To Reproduce
##### startup script #####
#!/opt/bin/lv_micropython -i
import lvgl as lv
import SDL
import display_driver
indev_drv1 = lv.indev_drv_t()
indev_drv1.init()
indev_drv1.type = lv.INDEV_TYPE.KEYPAD
indev_drv1.read_cb = SDL.keyboard_read
indev1 = indev_drv1.register()
scr = lv.obj()
lv.scr_load(scr)
container = lv.obj(lv.scr_act())
container.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP)
container.set_size(320, 240)
button = lv.btn(container)
label = lv.label(button)
label.set_text("Test1")
button2 = lv.btn(container)
label2 = lv.label(button2)
label2.set_text("Test2")
primarycolordd = lv.dropdown(container)
primarycolordd.set_options("\n".join(["White","Black"]))
primarycolordd.set_height(40)
group = lv.group_create()
group.add_obj(container)
indev1.set_group(group)
lv.gridnav_add(container, lv.GRIDNAV_CTRL.NONE)
Expected behavior
I would expect that focusing the dropdown menu and pressing enter would open it to choose from its values.
Screenshots or video
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 16 (7 by maintainers)
I don’t know yet. We got some feedback about
group
s, keypad’s key press handling and focusing in general requires some rework, but I haven’t started the planning yet.Anyway, this issue is an other thing that we should consider. The limiting factor here is that the object should know if it’s in editing state from it’s own data instead of from its group. This way objects could be controlled manually by gridnav as if they were in a group.
I added a not about it in the roadmap to be sure it won’t be forgotten: https://github.com/lvgl/lvgl/commit/bcf5d79cb4f868270d9f564a92a080e07280b67b
Hi,
Sorry for that it took so long. I’ve looked into it and found that it’s not worth to update gridnav at this moment as
groups
and keypad navigation in general will be updated in v9. So it’d be a very short term update.Instead I create a patch for you which is modify the gridnav to handle drop-downs correctly:
I can implement it, just wanted describe my idea to see if there are an objections.
Probably it will be required to create a dummy group in the gridnav to handle the editing state.