Surfaced by DeslanStudio milestone 4e (scale/key/preset pickers).
ui.dispatch's mousedown path runs _close_dropdowns of root FIRST — before _hit_test (lib/ui.eigs, "Close any open dropdowns first"). So when a combobox is open and the user clicks an item in its dropdown, the dropdown is closed before the hit test runs; the click lands on whatever sits underneath. _hit_test_combobox does extend the widget's bounds while open == 1, but by then open is already 0. Keyboard selection works only under app_loop (#563), so headlessly — and for mouse-only users under app_loop — a combobox can never change its selection via its dropdown.
Reproduce (headless, gfx stubbed like tests/test_ui.eigs): build combobox of ["cb", 10, 10, 120, ["a", "b"], null] in a panel, dispatch a mousedown on the combobox (opens it, open == 1), then dispatch a mousedown at the first dropdown item's position — selected stays -1 and open is 0.
Fix sketch: in dispatch's mousedown branch, hit-test BEFORE closing dropdowns, and if the hit is inside an open dropdown's extended bounds, deliver the click to it; only close dropdowns the click is outside of.
Downstream workaround (DeslanStudio wave/synth views): a button whose label shows the current value + a popup menu via show_menu — the menu widget selects on its own hover/mousedown path, which works under plain dispatch.
Surfaced by DeslanStudio milestone 4e (scale/key/preset pickers).
ui.dispatch's mousedown path runs_close_dropdowns of rootFIRST — before_hit_test(lib/ui.eigs, "Close any open dropdowns first"). So when acomboboxis open and the user clicks an item in its dropdown, the dropdown is closed before the hit test runs; the click lands on whatever sits underneath._hit_test_comboboxdoes extend the widget's bounds whileopen == 1, but by thenopenis already 0. Keyboard selection works only underapp_loop(#563), so headlessly — and for mouse-only users under app_loop — a combobox can never change its selection via its dropdown.Reproduce (headless, gfx stubbed like tests/test_ui.eigs): build
combobox of ["cb", 10, 10, 120, ["a", "b"], null]in a panel, dispatch a mousedown on the combobox (opens it,open == 1), then dispatch a mousedown at the first dropdown item's position —selectedstays -1 andopenis 0.Fix sketch: in dispatch's mousedown branch, hit-test BEFORE closing dropdowns, and if the hit is inside an open dropdown's extended bounds, deliver the click to it; only close dropdowns the click is outside of.
Downstream workaround (DeslanStudio wave/synth views): a
buttonwhose label shows the current value + a popupmenuviashow_menu— the menu widget selects on its own hover/mousedown path, which works under plain dispatch.