fix: remove getPopupContainer causing double scrollbar (#35833)#39657
fix: remove getPopupContainer causing double scrollbar (#35833)#396577487 wants to merge 1 commit into
Conversation
…pache#35833) Change all getPopupContainer defaults from triggerNode.parentNode/ parentElement/closest('.ant-modal-content') to document.body. This eliminates the double-scrollbar issue in Ant Design Select dropdowns when rendered inside scrollable containers (modals, panels, filter bars). Files changed: - Select.tsx / AsyncSelect.tsx: default parentNode → document.body - ColorSchemeControl (x2), ColorSchemeSelect.tsx: parentNode → body - DatabaseModal, GroupListModal, RoleFormItems, UserListModal: closest/modal → body - DateFilterLabel, CustomFrame, SelectFilterPlugin, GroupByFilterCard: overflow conditional → body Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Code Review Agent Run #201947Actionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
| getPopupContainer={trigger => | ||
| trigger.closest('.ant-modal-content') | ||
| } | ||
| getPopupContainer={() => document.body} |
There was a problem hiding this comment.
Suggestion: This change is incomplete for the modal: only the roles dropdown was moved to document.body, but the adjacent groups dropdown in the same form still uses .ant-modal-content and can still reproduce the double-scrollbar behavior the PR is fixing. Apply the same popup-container strategy consistently to the groups select so both fields behave correctly. [logic error]
Severity Level: Major ⚠️
- ❌ UsersList add/edit modal groups dropdown still double-scrolls.
- ⚠️ Inconsistent dropdown behavior between roles and groups fields.
- ⚠️ Admin UX degraded when many groups exist.Steps of Reproduction ✅
1. Navigate to the Users list page rendered by
`superset-frontend/src/pages/UsersList/index.tsx` (see lines 18-32 in the snippet where
`<UserListAddModal>` and `<UserListEditModal>` are used) and open the "Add user" modal by
clicking the "User" plus button, which triggers `openModal(ModalType.ADD)` (lines 2-15 in
the same file).
2. Opening the add/edit modal mounts `UserListModal` from
`superset-frontend/src/features/users/UserListModal.tsx` (function `UserListModal` at
lines 42-50), which renders a form inside `FormModal` including the `roles` and `groups`
fields (FormItems starting at the `name="roles"` block and the following `name="groups"`
block).
3. In `UserListModal.tsx`, observe that the `roles` `<Select>` uses `getPopupContainer={()
=> document.body}` (the new code at diff line 206, shown in the PR snippet) while the
adjacent `groups` `<Select>` still uses `getPopupContainer={trigger =>
trigger.closest('.ant-modal-content')}` (lines 66-76 in the second `Read` snippet for this
file), meaning only one of the two multi-selects was updated to the new popup-container
strategy.
4. With enough available groups to require scrolling, open the "Groups" dropdown in the
user modal: the options list is rendered inside the scrolling `.ant-modal-content`
container (due to `trigger.closest('.ant-modal-content')`) while the modal content itself
is scrollable, so the groups dropdown still shows a nested scrollbar inside the modal,
reproducing the double-scrollbar behavior that this PR is intended to eliminate for all
Selects in modals.Fix in Cursor | Fix in VSCode Claude
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset-frontend/src/features/users/UserListModal.tsx
**Line:** 206:206
**Comment:**
*Logic Error: This change is incomplete for the modal: only the `roles` dropdown was moved to `document.body`, but the adjacent `groups` dropdown in the same form still uses `.ant-modal-content` and can still reproduce the double-scrollbar behavior the PR is fixing. Apply the same popup-container strategy consistently to the `groups` select so both fields behave correctly.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix|
The flagged issue is correct. The PR updated the roles dropdown to use To resolve this, apply the same popup-container strategy to the groups Select by changing its The PR comments file shows no other review comments to address. superset-frontend/src/features/users/UserListModal.tsx |
|
@michael-s-molina @geido @kgabryje Hi! This PR removes the default |
|
Added them as reviewers and approved CI. Looks like there's a conflict to contend with... let's keep trying to move the ball forward :D |
Description
Fixes #35833 - Dropdown menu shows 2 scroll bars in Superset 6.0.0rc2.
The Ant Design Select component's
getPopupContainerwas set to render dropdowns inside their parent element (triggerNode.parentNode,trigger.closest('.ant-modal-content'), etc.). When the parent has limited height with overflow: auto, this creates a double-scrollbar effect — one for the parent container and one for the dropdown itself.Changes
triggerNode.parentNodetodocument.body() => document.bodyCo-Authored-By: Claude Opus 4.7 noreply@anthropic.com