Skip to content

fix(listbox): a widget inside a row keeps its press when it is not focusable - #28

Merged
zignd merged 1 commit into
mainfrom
fix/listbox-row-button-press
Nov 16, 2026
Merged

zignd merged 1 commit into
mainfrom
fix/listbox-row-button-press

Conversation

@zignd

@zignd zignd commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

A press that stops inside a ListBoxItem is forwarded to the owning ListBox so rows still select and activate on click (ListBoxRowPointerTest). The forwarding test was "the control it stopped at is not focusable", which misfires for widgets the author kept out of the Tab order: a Button or LineEdit with tabindex="-1" has FocusMode.None.

Observed in Trace Arena's map browser (a ul with data-activate="click" whose rows carry Edit/Rename/Delete buttons): pressing Delete ran Delete and activated the row, so the map opened instead of asking to confirm the deletion.

  • Control.ConsumesPointerPress is the rule now: the default keeps the previous FocusMode test, BaseButton and LineEdit answer true unconditionally.
  • The row lookup walks every control between the press target and the row, so a press on a button's own border or label is not read as row content either.

Tests: two new cases in ListBoxRowPointerTest (non-focusable button, press inside the button's container) fail before the change and pass after; the existing row-content cases still pass. Forma.Tests: 1328 passed.

…cusable

The row-content rule forwarded a stopped press to the owning ListBox whenever the control it stopped at was not
focusable, using FocusMode as the test for "this is an interactive widget". A button or text field with
tabindex="-1" has FocusMode.None, so in a list that activates on single click, pressing Delete on a row both ran
Delete and opened the item - the map browser opened the map instead of asking to confirm the deletion.

Controls now answer ConsumesPointerPress, which defaults to the old FocusMode test and is true for BaseButton and
LineEdit regardless of focusability. The row lookup also checks every control between the press target and the row,
so the button's own border or label cannot read as row content.
@zignd
zignd merged commit 1be38b6 into main Nov 16, 2026
26 of 30 checks passed
@zignd
zignd deleted the fix/listbox-row-button-press branch November 16, 2026 02:05
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.

1 participant