Fix dropdown#17152
Conversation
sdirix
left a comment
There was a problem hiding this comment.
Thanks for the contribution ❤️
2f89a7b to
a54dd9a
Compare
|
@sdirix Thank you for the detailed review and guidance! I have applied all of your suggestions: Moved to Core: Added the resize listener into SelectComponent.attachListeners() so it applies globally. (I also added a quick instanceof Node check to the hide function so the event.target window resize doesn't trigger a contains() TypeError). Lumino Update: Updated the ResizeObserver target in the preferences wrapper to use .lm-Widget. (Added a brief timeout to ensure the node is attached before querying the closest widget). Removed Redundancies: Completely removed the custom pointerdown/mousedown capture listeners from the wrapper, relying entirely on the core onBlur behavior. Coding Guidelines: Removed the _ prefix from the private resizeObserver property. Synced with Master: Reset the branch to drop the tree.css commit since it is already in master. I kept the ResizeObserver logic in the preferences wrapper because dragging the Lumino sash does not fire a global window.resize event, so the observer is still necessary to catch that specific layout shift. Let me know if this looks good to go! |
a54dd9a to
e1be4f5
Compare
|
Hi @sdirix, the linting error is fixed and the ResizeObserver logic is updated to observe the parent container directly. The CI is fully green! |
sdirix
left a comment
There was a problem hiding this comment.
Thanks for the update. I have one question and a comment. See comments.
e34c812 to
198f011
Compare
05347d1 to
6041caa
Compare
|
Hey @sdirix, I just removed that dispose() block! Regarding the failing Playwright tests: I realized the new ResizeObserver was catching a micro layout shift the millisecond the dropdown opened, causing it to snap shut before the UI bot could click anything. > If you would rather handle this with a debounce instead, just say the word and I can swap it out in two seconds! |
Signed-off-by: ankitsharma101 <ankitsharmaeclipse@gmail.com>
6041caa to
3d82e3a
Compare
What it does
Fixes the preference select dropdown staying open and mispositioned when the browser window is resized or when the Lumino split-panel sash is dragged (which shifts the layout but does not fire a standard window resize event).
Closes #12619
How to test
editor.wordWrapFollow-ups
The fix uses
(this.selectComponent.current as any).hide()to call the protectedhide()method onSelectComponentwithout modifying the core widget. A potential follow-up would be to expose a publicclose()method onSelectComponentto avoid this cast. A technical debt issue could be created for this.Breaking changes
Attribution
Review checklist
nlsservice (no user-facing text introduced in this PR)Reminder for reviewers