Repository navigation
fix(UIMultiSelection): show the options panel in the body; 3.1.7 - #60
Merged
Merged
Conversation
Inside the component the panel was positioned in page coordinates, so under an ancestor that is the containing block of absolute elements (`position`, `transform`, `filter`, `backdrop-filter`...) it was displaced by that ancestor's offset, and the ancestor's `overflow` clipped it: clicking the input showed nothing. Shown, the panel is now attached to the document's `body` (with the component's font and color); hidden, it returns after the input (also on `dispose` and on a new render). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 92.89% 92.95% +0.05%
==========================================
Files 34 34
Lines 9422 9483 +61
==========================================
+ Hits 8753 8815 +62
+ Misses 669 668 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… tests - The panel's default look (background, alignment, padding) is a `:where(...)` rule, not inline: an app rule styling `.ui-multi-selection-options-menu` now applies (the inline white background always won: light text over white on a dark theme). - In the `body` the component's inherited color and font properties are passed as `--ui-multi-selection-*` properties to that rule, so an app rule still takes precedence, as over inheritance. - The position is corrected by where the panel lands (a positioned body). - A new render keeps the panel shown, re-positioned, as before. - While shown, it's hidden if the input stops being displayed (a hidden ancestor) or leaves the document (a removed component, whose pending selection is cancelled). - Single selection: a radio group per instance (in the body, instances in and out of a form shared one). - Tests: placement on a scrolled page, a positioned body, above the input, after a resize; the app's CSS overriding the defaults; a new render, a removed component, a hidden ancestor; radios in and out of a form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e viewport's height On CI's shorter headless viewport the input (320px down) had less than 130px below it, so the panel was rightly placed above it. The input is now scrolled to 100px below the top of the viewport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
UIMultiSelectionrendered its options panel inside the component, positioned withposition: absolutein page coordinates (window.scroll + getBoundingClientRect()). That only holds when no ancestor is the containing block of absolute elements. Under an ancestor withposition,transform,filterorbackdrop-filter(e.g. a "glass" panel withbackdrop-filter: saturate(...)), the panel was displaced by that ancestor's offset, and the ancestor'soverflowclipped it: clicking the input showed nothing, not even "no options".Also, the panel's white background was an inline style, so an app rule styling
.ui-multi-selection-options-menunever applied (on a dark theme: light text over white).Fix
body: page coordinates are right there and no ancestor clips it. Hidden, it returns to the component, after the input (also ondispose()).body); also placed above the input near the viewport's bottom, and re-positioned on a window resize.:where(...)rule (no specificity) injected once, not inline, so any app rule wins.color,font-family/-size/-style/-weight,line-height,letter-spacinganddirectionare passed as--ui-multi-selection-*properties to that rule, so an app rule still takes precedence, as over inheritance.display: none, e.g. a hidden dialog; the selection is notified as on any hide), or leaves the document (a removed component; its pending selection is cancelled). Nomouseleavewould hide it there.body, the radios of an instance in a<form>and of one outside it shared a group, unchecking each other's.Behavior change worth noting: CSS rules that select the panel through the component's ancestors (e.g.
.my-box .ui-multi-selection-options-menu) no longer match it while shown. Rules on the panel's own class do, and now actually win over the defaults.Tests (
bones_ui_components_b_test.dart, "options panel placement")backdrop-filter+overflowancestor: shown right under the input, in thebody, with the component's font and color, and its options work; back after the input when hidden.body, above the input near the bottom of the viewport, and after a window resize.disposedoesn't leave it in thebody.<form>keep their selections.The regression tests fail on 3.1.6 (the panel landed 88px off under the
backdrop-filterbox).dart analyzeanddart formatare clean;dart test --platform vm(34) anddart test --platform chrome --compiler dart2wasm(561) pass; theUIMultiSelectiongroups also pass on dart2js.dart pub publish --dry-runhas no warnings other than uncommitted files.🤖 Generated with Claude Code