Keep toolbar dropdowns open during non-selection editor updates - #1161
Keep toolbar dropdowns open during non-selection editor updates#1161jorgemanrubia wants to merge 2 commits into
Conversation
The toolbar registered an editor update listener that closed every open dropdown on each update. While an upload is in progress the editor fires updates for progress and placeholder mutations, which closed any open toolbar dropdown unexpectedly. Close dropdowns only when the selection actually changed between the previous and current editor state, preserving the legitimate close on selection change while leaving dropdowns open for content-only updates. Gating the close on selection changes meant a dropdown no longer closed after the user picked one of its menuitems when the applied format left the selection unchanged. Close the dropdowns when a command is activated from a button inside a dropdown, so choosing a format item still closes the menu regardless of whether the selection moved.
1b06c7c to
939019c
Compare
Manual Validation: ValidatedValidated by driving a real browser (Selenium) against the released CDN build on the try-it page and against this branch locally. Primary (upload-progress / content-only update): Seeded text, clicked the text-style/heading dropdown trigger so the menu opened, then fired an editor update that mutated text content while leaving the selection untouched (the same kind of update upload progress / placeholder mutations produce). Observed the dropdown panel's
Regression guard (menuitem still closes the dropdown): Opened the text-style dropdown and clicked the "Large Heading" menuitem. In both production and local the dropdown closed after activating the format command, and the heading was applied. The PR's Verdict: production reproduces (dropdown closes on a non-selection update), local fixed (stays open), and the menuitem-close regression guard passes. |
Summary
Tests
Fixes Basecamp card #9933920069: Toolbar dropdowns close, while upload is progressing