Separate Menu.[open|close]Popup() methods instead of overriding hide/show logic - #701
Open
Gulvan0 wants to merge 7 commits into
Open
Separate Menu.[open|close]Popup() methods instead of overriding hide/show logic#701Gulvan0 wants to merge 7 commits into
Gulvan0 wants to merge 7 commits into
Conversation
…ing layout cursor VerticalLayout.repositionChildren applied marginTop(child) only when positioning the current child, then advanced ypos by componentHeight + verticalSpacing alone. marginBottom never affected sibling spacing, and marginTop of one child wasn't reflected in the next child's starting position, causing potential overlap. HorizontalLayout had the same issue with marginLeft/marginRight and xpos. Fixes margin-bottom (and margin-right) silently having no effect on sibling spacing inside vbox/hbox containers.
For each child, calcAutoSize computed the auto-size right/bottom bound as:
x2 = child.left + child.componentWidth - marginLeft(child) + marginRight(child)
child.left already includes marginLeft (Layout.repositionChildren positions it
at paddingLeft + marginLeft(child)), so subtracting marginLeft again here
shrinks the computed auto-width by exactly that amount whenever a child's
margins are asymmetric. The left bound had the mirrored mistake, adding
marginRight instead of leaving it alone. Same pattern for y1/y2 with
marginTop/marginBottom.
Corrected: x2 should just extend past the child's box by its own
marginRight, x1 should retreat before it by marginLeft - no cross terms.
FocusManager.enabled ("whether or not to allow focus management
globally") was only consulted inside buildFocusableList(), which backs
pushView/onViewReady/focusNext/focusPrev and the focus *getter*. The
focus *setter* - the one that actually calls applyFocus()/unapplyFocus()
and, via StyleFocusApplicator, adds/removes the ":active" CSS class -
never checked it.
InteractiveComponent's mouse-down handlers (Button, CheckBox,
NumberStepper, Slider, OptionStepper, TextField, TextArea, ItemPicker,
TableView, ListView) set `this.focus = true` directly, which routes
through this setter. So with FocusManager.instance.enabled = false, a
mouse click still applied the ":active" style (e.g. a button's focus
outline) even though auto-focus and tab-navigation were correctly
suppressed.
Guard the setter the same way buildFocusableList() already is: when
disabled, do nothing.
Respect FocusManager.enabled in the focus setter
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.
Minimal bug repro: https://haxeui.org/builder/?dd116136