Skip to content

fix(UI): remove getPopupContainer prop causing dual scrollbars in dropdown#36059

Open
shivamsahu-tech wants to merge 1 commit intoapache:masterfrom
shivamsahu-tech:fix/issue-35833-dropdown-dual-scrollbar
Open

fix(UI): remove getPopupContainer prop causing dual scrollbars in dropdown#36059
shivamsahu-tech wants to merge 1 commit intoapache:masterfrom
shivamsahu-tech:fix/issue-35833-dropdown-dual-scrollbar

Conversation

@shivamsahu-tech
Copy link

@shivamsahu-tech shivamsahu-tech commented Nov 10, 2025

fix(UI): remove getPopupContainer prop causing dual scrollbars in dropdown menus (#35833)

SUMMARY

This PR fixes the dual scrollbar issue appearing in dropdown menus.

The issue occurred because the getPopupContainer prop was being passed to the Ant Design Select component in both:

  • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
  • superset-frontend/src/features/databases/DatabaseModal/index.tsx

This prop forced dropdowns to render inside their parent container rather than the default document.body.
Since these parent containers have constrained height and overflow properties, the dropdown scrolled within the parent component, resulting in dual scrollbars and clipped dropdowns.

Edit: To avoid inconsistency, the latest changes only update the DatabaseModal/index.tsx file, modifying the getPopupContainer prop value while ensuring nothing else breaks.

BEFORE/AFTER SCREENSHOTS

Before (with issue)

Before Chrome

After (fixed)

After Chrome

TESTING INSTRUCTIONS

  1. Go to Settings → Database Connections in Superset.
  2. Click Databases, and open any supported database dropdown.
  3. Observe that the dropdown no longer shows dual scrollbars.
  4. Verify that dropdowns render fully and correctly without layout clipping.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Dropdown menu shows 2 scroll bars. #35833
  • Required feature flags: None
  • Changes UI (fixes visual bug)
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Nov 10, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
superset-frontend/src/features/databases/DatabaseModal/index.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@shivamsahu-tech shivamsahu-tech changed the title fix: remove getPopupContainer prop causing dual scrollbars in dropdow… fix(UI): remove getPopupContainer prop causing dual scrollbars in dropdown #35833 Nov 10, 2025
@shivamsahu-tech shivamsahu-tech changed the title fix(UI): remove getPopupContainer prop causing dual scrollbars in dropdown #35833 fix(UI): remove getPopupContainer prop causing dual scrollbars in dropdown Nov 10, 2025
Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #d4a06f

Actionable Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx - 1
    • Missing getPopupContainer prop in Select component · Line 734-739
Review Details
  • Files reviewed - 2 · Commit Range: c500faa..c500faa
    • superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx
    • superset-frontend/src/features/databases/DatabaseModal/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines 734 to 739
popupRender={popupRender}
filterOption={handleFilterOption}
filterSort={sortComparatorWithSearch}
getPopupContainer={
getPopupContainer || (triggerNode => triggerNode.parentNode)
}
headerPosition={headerPosition}
labelInValue={labelInValue}
maxTagCount={actualMaxTagCount}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing getPopupContainer prop in Select component

The getPopupContainer prop was removed from StyledSelect, creating inconsistency with AsyncSelect.tsx where it's still passed. This could break custom popup positioning if the prop is used. Add it back to ensure consistent behavior across Select components.

Code suggestion
Check the AI-generated fix before applying
Suggested change
popupRender={popupRender}
filterOption={handleFilterOption}
filterSort={sortComparatorWithSearch}
getPopupContainer={
getPopupContainer || (triggerNode => triggerNode.parentNode)
}
headerPosition={headerPosition}
labelInValue={labelInValue}
maxTagCount={actualMaxTagCount}
popupRender={popupRender}
filterOption={handleFilterOption}
filterSort={sortComparatorWithSearch}
getPopupContainer={
getPopupContainer || (triggerNode => triggerNode.parentNode)
}
headerPosition={headerPosition}
labelInValue={labelInValue}
maxTagCount={actualMaxTagCount}

Code Review Run #d4a06f


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a dual scrollbar issue in dropdown menus by removing the getPopupContainer prop from two locations in the codebase. The prop was forcing dropdowns to render within constrained parent containers, causing scrolling issues and visual clipping.

Key changes:

  • Removed getPopupContainer prop from the Select component in superset-ui-core
  • Removed getPopupContainer prop from the DatabaseModal component
  • Dropdowns now render to document.body by default (Ant Design's standard behavior)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx Removed default getPopupContainer implementation that was forcing dropdowns to render in parent nodes
superset-frontend/src/features/databases/DatabaseModal/index.tsx Removed getPopupContainer prop from database selector dropdown to prevent dual scrollbars

Comment on lines 734 to 736
popupRender={popupRender}
filterOption={handleFilterOption}
filterSort={sortComparatorWithSearch}
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getPopupContainer prop was removed here to fix the dual scrollbar issue, but it's still present in AsyncSelect.tsx (lines 611-613). For consistency and to ensure the same issue doesn't occur with async select dropdowns, consider removing it from AsyncSelect as well. This would ensure both Select components have consistent behavior and avoid potential dual scrollbar issues in async select dropdowns.

Copilot uses AI. Check for mistakes.
Comment on lines 734 to 736
popupRender={popupRender}
filterOption={handleFilterOption}
filterSort={sortComparatorWithSearch}
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getPopupContainer prop is still defined in the TypeScript interface AntdExposedProps (line 72 in types.ts), but it's no longer being used in the implementation. This creates a type/implementation mismatch where users can pass the prop without TypeScript errors, but it will be silently ignored.

Consider removing getPopupContainer from the AntdExposedProps type definition to match the implementation and prevent confusion.

Copilot uses AI. Check for mistakes.
@shivamsahu-tech
Copy link
Author

@geido @kgabryje @msyavuz
Hello!
Could you please take a look at this PR? If the current approach is inconsistent or causes issues, I’m happy to update it with a minimal change or example, keeping the AntD prop "getPopupContainer" and only replacing it with
triggerNode => document.body.

If there is a preferred or more correct way to handle this, I’m ready to update the implementation accordingly.

I had commented the whole solution approach in the issue section earlier, before this PR, but didn’t receive a response for a few weeks. Due to many contributors’ comments, I went ahead and opened this PR. I’m a student, so if I am missing anything, sorry for that.

@msyavuz
Copy link
Member

msyavuz commented Nov 17, 2025

Hey @shivamsahu-tech, copilot is mostly correct on this and the fix should probably be scoped to that dataset select component. Select is used all around and removing that getPopupContainer prop passthrough would break a lot of other things. Thanks for opening a pr and taking care of this!

@shivamsahu-tech shivamsahu-tech force-pushed the fix/issue-35833-dropdown-dual-scrollbar branch from 5b4038f to 4fa1b1b Compare November 17, 2025 21:10
@github-actions github-actions bot removed the packages label Nov 17, 2025
@shivamsahu-tech
Copy link
Author

Hey @msyavuz ,

Sorry for the previous inconsistent changes.

In this new fix, I’ve only updated the "DatabaseModal/index.tsx" file, only modifying the value of the "getPopupContainer" prop. The change is scoped to this component only. Tested locally, it works fine.

I think everything should be in order now. If there’s any issue, please let me know, I’m happy to learn and improve as a student.

@shivamsahu-tech
Copy link
Author

Hey @msyavuz @kgabryje ,
After comparing this component with others and debugging further, I found an alternative solution besides rendering the dropdown in document.body.

Here .ant-select-dropdown was getting height: 160px (visible in browser dev tools)
.superset-101v6sl .ant-select-dropdown {
height: 160px;
}
Meanwhile, its child .rc-virtual-list-holder has height: 256px, resulting in the dual scrollbar issue.

Adding only height: 'auto' to the dropdownStyle prop allows the parent container to expand and accommodate the child's size instead of being constrained to 160px, that resolve the dual scrollbar issue, tested locally.

Changes: DatabaseModal/index.tsx (at line 1137)

// OLD
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}

// NEW 
dropdownStyle={{ maxHeight: 400, overflow: 'auto',  height: 'auto' }}

This is a minimal change (one additional property) and shouldn't affect anything else.
Please review this solution. If it looks good or have better approach, let me know, I'll update the file.

@hassaansaleem28
Copy link

I reproduced this locally on the latest master and confirmed that setting height: auto (or removing the fixed height) resolves the double scrollbar issue without regressions in the other dropdowns I tested.

So yeah this confirms that the fix proposed in #36059 addresses the issue. Happy to help with further testing or validation if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dropdown menu shows 2 scroll bars.

4 participants