sadpandajoe opened a new pull request, #45580:
URL: https://github.com/apache/superset/pull/45580

   ### SUMMARY
   On a dashboard with a horizontal native filter bar, expanding **Filters out 
of scope** inside an already-open **More filters** popover grows its content 
past the popover's 500px max height, but the filters spill below the popover 
background instead of scrolling. Closing and reopening the popover "fixes" it.
   
   Root cause: `DropdownContainer` decides whether its popover should scroll by 
measuring the content's `scrollHeight` once, 100ms after the popover opens (the 
`[popoverVisible]` layout effect). Between that measurement and the next open, 
the popover keeps `max-height: 500px` with `overflow: visible`, so any growth 
while it is open — such as expanding the out-of-scope collapsible — overflows 
the background. This one-shot measurement dates back to the original overflow 
support in #22250 (afc10a247b) and is present in 6.1.0 and on master.
   
   Fix: after the initial measurement, observe the popover content with a 
`ResizeObserver` while the popover is open and update the scroll state whenever 
its size changes; disconnect the observer (and clear the pending timeout) when 
the popover closes. The 500px cap and the "only scroll when content exceeds it" 
behavior, which avoids clipping Select dropdowns inside the popover, are 
unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Screenshots were not captured: the preview environment for this branch 
failed to start. The steps under TESTING INSTRUCTIONS show the before/after 
behavior; the screenshot in #45577 shows the "before" state.
   
   ### TESTING INSTRUCTIONS
   1. Open a dashboard with many native filters, some of them scoped so they 
are out of scope for the dashboard's charts.
   2. Set the filter bar orientation to **Horizontal** and narrow the window so 
several filters move under **More filters**.
   3. Click **More filters**, then expand **Filters out of scope** inside the 
popover.
   4. Before this change: the expanded filters extend past the bottom of the 
popover background with no scrollbar. After: the popover stays within its 500px 
height and shows a scrollbar immediately, without needing to close and reopen 
it.
   5. With few enough filters that the content fits within 500px, open the 
popover and a Select filter's dropdown inside it; confirm the dropdown is not 
clipped (unchanged behavior).
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Fixes #45577
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   Notes:
   - The new test replaces `global.ResizeObserver` and calls 
`jest.useRealTimers()` in the test body rather than in a `finally`/`afterEach`, 
so it is the last test in the file by design; a test added after it would 
inherit the mock.
   - The observer attaches to the content node 100ms after opening, so if that 
node were remounted while the popover stays open it would not be observed until 
the next open (same as before this change, not a regression).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to