Repository navigation
fix(listbox): a widget inside a row keeps its press when it is not focusable - #28
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A press that stops inside a
ListBoxItemis forwarded to the owningListBoxso 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: aButtonorLineEditwithtabindex="-1"hasFocusMode.None.Observed in Trace Arena's map browser (a
ulwithdata-activate="click"whose rows carry Edit/Rename/Delete buttons): pressing Delete ranDeleteand activated the row, so the map opened instead of asking to confirm the deletion.Control.ConsumesPointerPressis the rule now: the default keeps the previousFocusModetest,BaseButtonandLineEditanswer true unconditionally.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.