You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/10/22 03:21:50 UTC
[PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
rusackas opened a new pull request, #45604:
URL: https://github.com/apache/superset/pull/45604
## Description
Adopts #39657 (fix: remove getPopupContainer causing double scrollbar, #35833), by @7487, with the narrower scope @rusackas and @7487 landed on in review there.
The double scrollbar only comes from the `triggerNode.parentNode` fallback (and the equivalent explicit `parentNode` usage in `ColorSchemeControl`, `ColorSchemeSelect`, and `GroupByFilterCard`): an absolutely positioned popup laid out inside an `overflow: auto` box grows a scrollbar of its own next to the virtual list's. The `.closest('.ant-modal-container')` branch doesn't exhibit this, so it's kept as-is, preserving the antd 6 modal-containment contract (and `antdDomContract.test.tsx`) that #39657's original broader diff would have flipped.
Pushing this as a fresh PR rather than to @7487's branch directly: the fork's branch has drifted far enough from current `master` (a `.github/workflows/bashlib.sh` divergence) that a GitHub App token without `workflow` scope can't push to it.
## BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A โ behavioral/bugfix change, no visual change beyond the reported double scrollbar going away.
## TESTING INSTRUCTIONS
Open a Select inside a tall modal where the trigger's non-modal ancestor has `overflow: auto` (the original repro in #35833) โ one scrollbar now, not two. Modal-contained popups (e.g. role/group pickers) are unaffected; `antdDomContract.test.tsx` still asserts that containment.
## ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #35833
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
๐ค 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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4355858456
##########
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx:
##########
@@ -1003,7 +1003,7 @@ const Select = forwardRef(
getPopupContainer ||
((triggerNode: HTMLElement) =>
(triggerNode?.closest('.ant-modal-container') as HTMLElement) ||
- (triggerNode.parentNode as HTMLElement))
+ document.body)
Review Comment:
Good catch. The Select now asks the ConfigProvider (so the fullscreen-aware container from ChartHolder) before falling back to document.body, same for AsyncSelect. The modal check still wins first.
##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -873,7 +873,7 @@ const AsyncSelect = forwardRef(
getPopupContainer ||
((triggerNode: HTMLElement) =>
(triggerNode?.closest('.ant-modal-container') as HTMLElement) ||
- (triggerNode.parentNode as HTMLElement))
+ document.body)
Review Comment:
Fair, added popupContainer.test.tsx, parameterized over Select and AsyncSelect. One case renders in a scrollable non-modal wrapper and asserts the popup lands under document.body outside the wrapper, the other checks a ConfigProvider container is honored. I could not run jest locally (no deps on this box), so CI will be the first real run.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #45604:
URL: https://github.com/apache/superset/pull/45604#issuecomment-6351999863
### <span aria-hidden="true">โ
</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">๐จ</span> Latest commit | 7c89d0ecfabd27c3e1b37d00636d849e2af8a95e |
|<span aria-hidden="true">๐</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6ada82ddb4c03c63cc66568c |
|<span aria-hidden="true">๐</span> Deploy Preview | [https://deploy-preview-45604--superset-docs-preview.netlify.app](https://deploy-preview-45604--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">๐ฑ</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">๐ค</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcrLCYAwDADQXXJWFD-huIFjpImiUJsSFRVxd3t7h_dCMt3SAQNAAd4o8pI9r3clevowlTubhuDJykhmeuUmUwr6jJIjkpBrRHzHdcvYMiP26Bi-Hw) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-45604--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #45604:
URL: https://github.com/apache/superset/pull/45604#issuecomment-6347235903
@rusackas I know your PR says there are no visual changes, but can you show a popup that has double scrollbars and now it's back to single?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4365796449
##########
superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx:
##########
@@ -151,6 +151,33 @@ test('displays color scheme options', async () => {
});
});
+test('grouped-option styles reach the popup portaled to document.body', async () => {
+ [...CategoricalD3, ...CategoricalModernSunset].forEach(scheme =>
+ getCategoricalSchemeRegistry().registerValue(scheme.id, scheme),
+ );
+ setup();
+ await userEvent.click(
+ screen.getByLabelText('Select color scheme', { selector: 'input' }),
+ );
+ await waitFor(() => {
+ expect(screen.getByText('Featured color palettes')).toBeInTheDocument();
+ });
+ const popup = document.querySelector('.ant-select-dropdown')!;
+ expect(popup.closest('body')).toBe(document.body);
Review Comment:
`popup.closest('body')` is `document.body` for any popup in the document, including one rendered inline under the trigger's parent. If `getPopupContainer` in `ColorSchemeControl` went back to `triggerNode.parentNode`, this test would still pass while the double scrollbar returned in a scrollable ancestor. The class assertion below only proves the styles reach the popup root, not where it portals. Could this assert the popup is not contained by the control's rendered container (as `popupContainer.test.tsx` does for the Select default)?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #45604:
URL: https://github.com/apache/superset/pull/45604
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4354601348
##########
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx:
##########
@@ -1003,7 +1003,7 @@ const Select = forwardRef(
getPopupContainer ||
((triggerNode: HTMLElement) =>
(triggerNode?.closest('.ant-modal-container') as HTMLElement) ||
- (triggerNode.parentNode as HTMLElement))
+ document.body)
Review Comment:
This fallback now ignores the fullscreen-aware `getPopupContainer` that `ChartHolder` supplies through `AntdThemeProvider`, because an explicit callback on the Select wins over the provider. In chart fullscreen, a Select with no override (e.g. the AG Grid table's `SearchSelectDropdown` "Search by") will portal its options to `document.body`, outside the fullscreen element, so they won't be visible or clickable. Previously the `parentNode` fallback kept them inside. Could the default defer to the provider's container (or keep fullscreen containment) before falling back to `document.body`? The same applies to `AsyncSelect`.
##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -873,7 +873,7 @@ const AsyncSelect = forwardRef(
getPopupContainer ||
((triggerNode: HTMLElement) =>
(triggerNode?.closest('.ant-modal-container') as HTMLElement) ||
- (triggerNode.parentNode as HTMLElement))
+ document.body)
Review Comment:
Nothing in the PR exercises this default: the new GroupBy and color-scheme tests all pass an explicit popup container, and `popup.closest('body')` would also pass for an inline popup. Reverting this (or the `Select.tsx` twin) to `triggerNode.parentNode` would bring the double scrollbar back with every test green. Could you add a test, parameterized over `Select` and `AsyncSelect`, that renders inside a non-modal scrollable wrapper with no `getPopupContainer`, opens the dropdown, and asserts the popup's parent is `document.body` and not inside the wrapper? `antdDomContract.test.tsx` already covers the modal side.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4367115894
##########
superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx:
##########
@@ -172,27 +173,42 @@ const ColorSchemeSelect = ({
return (
<>
- <Select
- css={css`
- width: 100%;
- & .ant-select-item.ant-select-item-group {
- padding-left: ${theme.sizeUnit}px;
- font-size: ${theme.fontSize}px;
- }
- & .ant-select-item-option-grouped {
- padding-left: ${theme.sizeUnit * 3}px;
- }
- `}
- aria-label={t('Select color scheme')}
- allowClear={clearable}
- onChange={onChange}
- placeholder={t('Select scheme')}
- value={currentScheme}
- showSearch
- getPopupContainer={triggerNode => triggerNode.parentNode}
- options={options}
- optionFilterProps={['label', 'value', 'searchText']}
- />
+ <ClassNames>
+ {({ css: popupCss }) => (
+ <Select
+ css={css`
+ width: 100%;
+ `}
+ // the popup portals to document.body, out of the css prop's
+ // scope, so the grouped-option styles ride along on its root
+ classNames={{
+ popup: {
+ root: popupCss`
+ .ant-select-item.ant-select-item-group {
+ padding-left: ${theme.sizeUnit}px;
+ font-size: ${theme.fontSize}px;
+ }
+ .ant-select-item-option-grouped {
+ padding-left: ${theme.sizeUnit * 3}px;
+ }
+ `,
+ },
+ }}
+ aria-label={t('Select color scheme')}
+ allowClear={clearable}
+ onChange={onChange}
+ placeholder={t('Select scheme')}
+ value={currentScheme}
+ showSearch
+ getPopupContainer={triggerNode =>
Review Comment:
The modal-aware fallback here is the piece that keeps the palette scrolling with its trigger inside `PropertiesModal`, but nothing exercises it: the PropertiesModal and StylingSection tests mock `ColorSchemeSelect`, and the new core tests cover `Select`'s own default rather than this override. If this callback were replaced with `() => document.body`, every existing test would still pass while the palette detached from the modal again. Could you add a test that renders the real `ColorSchemeSelect` inside an `.ant-modal-container`, opens it, and asserts the popup lands under that container (plus one outside a modal asserting it lands under `document.body`)?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4366651636
##########
superset-frontend/plugins/plugin-chart-word-cloud/package.json:
##########
@@ -39,6 +39,7 @@
},
"peerDependencies": {
"@apache-superset/core": "*",
+ "@emotion/react": "^11.4.1",
Review Comment:
The new `@emotion/react` peer is declared here but the `plugins/plugin-chart-word-cloud` entry in `superset-frontend/package-lock.json` still lists the old peer set, so the manifest and lockfile disagree. A strict `npm ci` could flag the lockfile as out of sync, and the next `npm install` will rewrite it. Could you regenerate the lockfile so both change together?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4367101620
##########
superset-frontend/plugins/plugin-chart-word-cloud/package.json:
##########
@@ -39,6 +39,7 @@
},
"peerDependencies": {
"@apache-superset/core": "*",
+ "@emotion/react": "^11.4.1",
Review Comment:
Good catch. Lockfile entry for the word-cloud plugin now lists the `@emotion/react` peer too.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4369896273
##########
superset-frontend/src/dashboard/components/ColorSchemeSelect.test.tsx:
##########
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import {
+ render,
+ screen,
+ userEvent,
+ waitFor,
+} from 'spec/helpers/testing-library';
+import ColorSchemeSelect from './ColorSchemeSelect';
+
+const openAndGetPopup = async () => {
+ await userEvent.click(
+ screen.getByRole('combobox', { name: 'Select color scheme' }),
+ );
+ await waitFor(() =>
+ expect(document.querySelector('.ant-select-dropdown')).toBeInTheDocument(),
+ );
+ return document.querySelector('.ant-select-dropdown') as HTMLElement;
+};
+
+test('portals the palette inside the enclosing modal container', async () => {
+ render(
+ <div className="ant-modal-container" data-test="modal">
+ <ColorSchemeSelect onChange={jest.fn()} />
+ </div>,
+ );
+ const popup = await openAndGetPopup();
+ expect(screen.getByTestId('modal').contains(popup)).toBe(true);
+});
+
+test('portals the palette to document.body outside a modal', async () => {
+ render(
+ <div data-test="wrapper">
+ <ColorSchemeSelect onChange={jest.fn()} />
+ </div>,
+ );
+ const popup = await openAndGetPopup();
+ expect(screen.getByTestId('wrapper').contains(popup)).toBe(false);
+ expect(document.body.contains(popup)).toBe(true);
Review Comment:
Added a grouped-scheme test to `ColorSchemeSelect.test.tsx` that checks the popup root carries an emotion class whose rule targets `.ant-select-item-option-grouped`. Not run locally, so CI is the first real run.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4366091601
##########
superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx:
##########
@@ -151,6 +151,33 @@ test('displays color scheme options', async () => {
});
});
+test('grouped-option styles reach the popup portaled to document.body', async () => {
+ [...CategoricalD3, ...CategoricalModernSunset].forEach(scheme =>
+ getCategoricalSchemeRegistry().registerValue(scheme.id, scheme),
+ );
+ setup();
+ await userEvent.click(
+ screen.getByLabelText('Select color scheme', { selector: 'input' }),
+ );
+ await waitFor(() => {
+ expect(screen.getByText('Featured color palettes')).toBeInTheDocument();
+ });
+ const popup = document.querySelector('.ant-select-dropdown')!;
+ expect(popup.closest('body')).toBe(document.body);
Review Comment:
Good point. The assertion now checks the popup is not inside the control's rendered container, so a regression to `triggerNode.parentNode` would fail it.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45604:
URL: https://github.com/apache/superset/pull/45604#issuecomment-6331975080
## CodeAnt PR Risk: Medium Risk
- The PR needs attention before merging.
- The color-scheme popup now portals to document.body, so in the scrollable PropertiesModal it can escape the modal and stop scrolling with its trigger.
**Assessed commit:** `5c91acc9a73f`
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4344267017
##########
superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx:
##########
@@ -172,27 +173,39 @@ const ColorSchemeSelect = ({
return (
<>
- <Select
- css={css`
- width: 100%;
- & .ant-select-item.ant-select-item-group {
- padding-left: ${theme.sizeUnit}px;
- font-size: ${theme.fontSize}px;
- }
- & .ant-select-item-option-grouped {
- padding-left: ${theme.sizeUnit * 3}px;
- }
- `}
- aria-label={t('Select color scheme')}
- allowClear={clearable}
- onChange={onChange}
- placeholder={t('Select scheme')}
- value={currentScheme}
- showSearch
- getPopupContainer={triggerNode => triggerNode.parentNode}
- options={options}
- optionFilterProps={['label', 'value', 'searchText']}
- />
+ <ClassNames>
+ {({ css: popupCss }) => (
+ <Select
+ css={css`
+ width: 100%;
+ `}
+ // the popup portals to document.body, out of the css prop's
+ // scope, so the grouped-option styles ride along on its root
+ classNames={{
+ popup: {
+ root: popupCss`
+ .ant-select-item.ant-select-item-group {
+ padding-left: ${theme.sizeUnit}px;
+ font-size: ${theme.fontSize}px;
+ }
+ .ant-select-item-option-grouped {
+ padding-left: ${theme.sizeUnit * 3}px;
+ }
+ `,
+ },
+ }}
+ aria-label={t('Select color scheme')}
+ allowClear={clearable}
+ onChange={onChange}
+ placeholder={t('Select scheme')}
+ value={currentScheme}
+ showSearch
+ getPopupContainer={() => document.body}
Review Comment:
**Suggestion:** When opened in the scrollable PropertiesModal, the palette escapes the modal, so it is no longer clipped or scrolled with its trigger.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a2fd8a8d0bef48eda59742d9ea983c8d&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=a2fd8a8d0bef48eda59742d9ea983c8d&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx
**Line:** 203:203
**Comment:**
*Api Mismatch: When opened in the scrollable PropertiesModal, the palette escapes the modal, so it is no longer clipped or scrolled with its trigger.
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
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45604&comment_hash=341b09b6079da0c14336b70e38ffec96f74f1700c154fe99d11c4a4979c71cb5&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45604&comment_hash=341b09b6079da0c14336b70e38ffec96f74f1700c154fe99d11c4a4979c71cb5&reaction=dislike'>๐</a>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4367773821
##########
superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx:
##########
@@ -304,28 +305,40 @@ const ColorSchemeControl = ({
/>
}
/>
- <Select
- css={css`
- width: 100%;
- & .ant-select-item.ant-select-item-group {
- padding-left: ${theme.sizeUnit}px;
- font-size: ${theme.fontSize}px;
- }
- & .ant-select-item-option-grouped {
- padding-left: ${theme.sizeUnit * 3}px;
- }
- `}
- aria-label={t('Select color scheme')}
- allowClear={clearable}
- disabled={hasDashboardScheme || hasSharedLabelsColor}
- onChange={handleOnChange}
- placeholder={t('Select scheme')}
- value={currentScheme}
- showSearch
- getPopupContainer={triggerNode => triggerNode.parentNode}
- options={options}
- optionFilterProps={['label', 'value', 'searchText']}
- />
+ <ClassNames>
+ {({ css: popupCss }) => (
+ <Select
+ css={css`
+ width: 100%;
+ `}
+ // the popup portals to document.body, out of the css prop's
+ // scope, so the grouped-option styles ride along on its root
+ classNames={{
+ popup: {
+ root: popupCss`
+ .ant-select-item.ant-select-item-group {
+ padding-left: ${theme.sizeUnit}px;
+ font-size: ${theme.fontSize}px;
+ }
+ .ant-select-item-option-grouped {
+ padding-left: ${theme.sizeUnit * 3}px;
+ }
+ `,
+ },
+ }}
+ aria-label={t('Select color scheme')}
+ allowClear={clearable}
+ disabled={hasDashboardScheme || hasSharedLabelsColor}
+ onChange={handleOnChange}
+ placeholder={t('Select scheme')}
+ value={currentScheme}
+ showSearch
+ getPopupContainer={() => document.body}
Review Comment:
This plugin carries its own copy of the portaled-popup change, but `test/ColorSchemeControl.test.tsx` only covers rendering and selection. Reverting this `getPopupContainer` to `triggerNode.parentNode`, or moving the grouped-option styles back under the trigger's `css`, would leave every test green (the new Explore control test exercises a different component). Could you add a test here with registered grouped palettes that asserts the opened popup is outside the control's container and that the grouped-option padding rule is attached to the popup root?
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.test.tsx:
##########
@@ -532,3 +532,28 @@ test('shows no message while at least one allowed column remains', async () => {
expect(await screen.findByText('Country')).toBeInTheDocument();
expect(screen.queryByText(allowlistGoneMessage)).not.toBeInTheDocument();
});
+
+test('horizontal layout keeps the 200-400px popup width constraints', async () => {
+ // The popup portals to document.body, outside HorizontalFormItem's styled
+ // scope, so the width clamp must arrive as inline popup styles instead.
+ fetchMock.get('glob:*/api/v1/dataset/325', {
+ result: { table_name: 'Vehicle Sales', columns: [{ column_name: 'city' }] },
+ });
+
+ render(
+ <GroupByFilterCard
+ customizationItem={customization([{ datasetId: 325 }])}
+ orientation="horizontal"
+ />,
+ { useRedux: true, initialState },
+ );
+
+ await userEvent.click(await screen.findByRole('combobox'));
+ await waitFor(() => {
+ expect(document.querySelector('.ant-select-dropdown')).not.toBeNull();
+ });
+ expect(document.querySelector('.ant-select-dropdown')).toHaveStyle({
+ minWidth: '200px',
Review Comment:
This only asserts the popup's min/max width, so putting `getPopupContainer={trigger => trigger.parentNode}` back on this caller would keep the widths (they ride on the inline styles) and still pass while the double scrollbar returned in the horizontal filter bar. The shared Select tests can't catch it either, because this caller passes its own container. Could you render the card inside an `overflow: auto` wrapper and assert the opened `.ant-select-dropdown` is not contained in it, as `ColorSchemeSelect.test.tsx` does?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4369367353
##########
superset-frontend/src/dashboard/components/ColorSchemeSelect.test.tsx:
##########
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import {
+ render,
+ screen,
+ userEvent,
+ waitFor,
+} from 'spec/helpers/testing-library';
+import ColorSchemeSelect from './ColorSchemeSelect';
+
+const openAndGetPopup = async () => {
+ await userEvent.click(
+ screen.getByRole('combobox', { name: 'Select color scheme' }),
+ );
+ await waitFor(() =>
+ expect(document.querySelector('.ant-select-dropdown')).toBeInTheDocument(),
+ );
+ return document.querySelector('.ant-select-dropdown') as HTMLElement;
+};
+
+test('portals the palette inside the enclosing modal container', async () => {
+ render(
+ <div className="ant-modal-container" data-test="modal">
+ <ColorSchemeSelect onChange={jest.fn()} />
+ </div>,
+ );
+ const popup = await openAndGetPopup();
+ expect(screen.getByTestId('modal').contains(popup)).toBe(true);
+});
+
+test('portals the palette to document.body outside a modal', async () => {
+ render(
+ <div data-test="wrapper">
+ <ColorSchemeSelect onChange={jest.fn()} />
+ </div>,
+ );
+ const popup = await openAndGetPopup();
+ expect(screen.getByTestId('wrapper').contains(popup)).toBe(false);
+ expect(document.body.contains(popup)).toBe(true);
Review Comment:
The grouped-option padding and font rules were moved onto the popup root class here, but neither new test looks at them: both only check where the popup lands. If the `classNames.popup.root` block in `ColorSchemeSelect` were dropped while the container callback stayed, both tests would still pass and the group headings and grouped options would silently lose their styling in the dashboard properties modal. The explore and word-cloud controls each got a test for this, but this component has its own copy. Could you register a grouped scheme set and assert the popup root carries an emotion class whose stylesheet rule targets `.ant-select-item-option-grouped`, as in the explore `ColorSchemeControl` test?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4353832771
##########
superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx:
##########
@@ -172,27 +173,39 @@ const ColorSchemeSelect = ({
return (
<>
- <Select
- css={css`
- width: 100%;
- & .ant-select-item.ant-select-item-group {
- padding-left: ${theme.sizeUnit}px;
- font-size: ${theme.fontSize}px;
- }
- & .ant-select-item-option-grouped {
- padding-left: ${theme.sizeUnit * 3}px;
- }
- `}
- aria-label={t('Select color scheme')}
- allowClear={clearable}
- onChange={onChange}
- placeholder={t('Select scheme')}
- value={currentScheme}
- showSearch
- getPopupContainer={triggerNode => triggerNode.parentNode}
- options={options}
- optionFilterProps={['label', 'value', 'searchText']}
- />
+ <ClassNames>
+ {({ css: popupCss }) => (
+ <Select
+ css={css`
+ width: 100%;
+ `}
+ // the popup portals to document.body, out of the css prop's
+ // scope, so the grouped-option styles ride along on its root
+ classNames={{
+ popup: {
+ root: popupCss`
+ .ant-select-item.ant-select-item-group {
+ padding-left: ${theme.sizeUnit}px;
+ font-size: ${theme.fontSize}px;
+ }
+ .ant-select-item-option-grouped {
+ padding-left: ${theme.sizeUnit * 3}px;
+ }
+ `,
+ },
+ }}
+ aria-label={t('Select color scheme')}
+ allowClear={clearable}
+ onChange={onChange}
+ placeholder={t('Select scheme')}
+ value={currentScheme}
+ showSearch
+ getPopupContainer={() => document.body}
Review Comment:
Good catch. The popup now stays inside `.ant-modal-container` when there is one and only falls back to `document.body` otherwise, so it scrolls with its trigger in `PropertiesModal`.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #45604:
URL: https://github.com/apache/superset/pull/45604#issuecomment-6354991401
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45604?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `69.23077%` with `4 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 84.10%. Comparing base ([`4e5d0ef`](https://app.codecov.io/gh/apache/superset/commit/4e5d0ef8f13d1b878801851e1801f9672ef155e4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e1e0e68`](https://app.codecov.io/gh/apache/superset/commit/e1e0e68cdf76c962c301b198fec1c6ed24a7d50b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 22 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/45604?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...end/src/dashboard/components/ColorSchemeSelect.tsx](https://app.codecov.io/gh/apache/superset/pull/45604?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fdashboard%2Fcomponents%2FColorSchemeSelect.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0NvbG9yU2NoZW1lU2VsZWN0LnRzeA==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/45604?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...d/src/plugin/controls/ColorSchemeControl/index.tsx](https://app.codecov.io/gh/apache/superset/pull/45604?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-word-cloud%2Fsrc%2Fplugin%2Fcontrols%2FColorSchemeControl%2Findex.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtd29yZC1jbG91ZC9zcmMvcGx1Z2luL2NvbnRyb2xzL0NvbG9yU2NoZW1lQ29udHJvbC9pbmRleC50c3g=) | 66.66% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/45604?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #45604 +/- ##
=======================================
Coverage 84.10% 84.10%
=======================================
Files 3056 3056
Lines 201285 201291 +6
Branches 47066 47068 +2
=======================================
+ Hits 169299 169305 +6
Misses 28747 28747
Partials 3239 3239
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/45604/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage ฮ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/45604/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.16% <69.23%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/45604?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4369347788
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.test.tsx:
##########
@@ -532,3 +532,28 @@ test('shows no message while at least one allowed column remains', async () => {
expect(await screen.findByText('Country')).toBeInTheDocument();
expect(screen.queryByText(allowlistGoneMessage)).not.toBeInTheDocument();
});
+
+test('horizontal layout keeps the 200-400px popup width constraints', async () => {
+ // The popup portals to document.body, outside HorizontalFormItem's styled
+ // scope, so the width clamp must arrive as inline popup styles instead.
+ fetchMock.get('glob:*/api/v1/dataset/325', {
+ result: { table_name: 'Vehicle Sales', columns: [{ column_name: 'city' }] },
+ });
+
+ render(
+ <GroupByFilterCard
+ customizationItem={customization([{ datasetId: 325 }])}
+ orientation="horizontal"
+ />,
+ { useRedux: true, initialState },
+ );
+
+ await userEvent.click(await screen.findByRole('combobox'));
+ await waitFor(() => {
+ expect(document.querySelector('.ant-select-dropdown')).not.toBeNull();
+ });
+ expect(document.querySelector('.ant-select-dropdown')).toHaveStyle({
+ minWidth: '200px',
Review Comment:
Added a test that renders the horizontal card inside an `overflow: auto` wrapper and asserts the opened dropdown is outside it. Not run locally, so CI is the first real run.
##########
superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx:
##########
@@ -304,28 +305,40 @@ const ColorSchemeControl = ({
/>
}
/>
- <Select
- css={css`
- width: 100%;
- & .ant-select-item.ant-select-item-group {
- padding-left: ${theme.sizeUnit}px;
- font-size: ${theme.fontSize}px;
- }
- & .ant-select-item-option-grouped {
- padding-left: ${theme.sizeUnit * 3}px;
- }
- `}
- aria-label={t('Select color scheme')}
- allowClear={clearable}
- disabled={hasDashboardScheme || hasSharedLabelsColor}
- onChange={handleOnChange}
- placeholder={t('Select scheme')}
- value={currentScheme}
- showSearch
- getPopupContainer={triggerNode => triggerNode.parentNode}
- options={options}
- optionFilterProps={['label', 'value', 'searchText']}
- />
+ <ClassNames>
+ {({ css: popupCss }) => (
+ <Select
+ css={css`
+ width: 100%;
+ `}
+ // the popup portals to document.body, out of the css prop's
+ // scope, so the grouped-option styles ride along on its root
+ classNames={{
+ popup: {
+ root: popupCss`
+ .ant-select-item.ant-select-item-group {
+ padding-left: ${theme.sizeUnit}px;
+ font-size: ${theme.fontSize}px;
+ }
+ .ant-select-item-option-grouped {
+ padding-left: ${theme.sizeUnit * 3}px;
+ }
+ `,
+ },
+ }}
+ aria-label={t('Select color scheme')}
+ allowClear={clearable}
+ disabled={hasDashboardScheme || hasSharedLabelsColor}
+ onChange={handleOnChange}
+ placeholder={t('Select scheme')}
+ value={currentScheme}
+ showSearch
+ getPopupContainer={() => document.body}
Review Comment:
Added a grouped-palette test here that asserts the popup is outside the control container and that the grouped-option rule is attached to the popup root class. Not run locally, so CI is the first real run.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: remove getPopupContainer causing double scrollbar (#35833) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4367601762
##########
superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx:
##########
@@ -172,27 +173,42 @@ const ColorSchemeSelect = ({
return (
<>
- <Select
- css={css`
- width: 100%;
- & .ant-select-item.ant-select-item-group {
- padding-left: ${theme.sizeUnit}px;
- font-size: ${theme.fontSize}px;
- }
- & .ant-select-item-option-grouped {
- padding-left: ${theme.sizeUnit * 3}px;
- }
- `}
- aria-label={t('Select color scheme')}
- allowClear={clearable}
- onChange={onChange}
- placeholder={t('Select scheme')}
- value={currentScheme}
- showSearch
- getPopupContainer={triggerNode => triggerNode.parentNode}
- options={options}
- optionFilterProps={['label', 'value', 'searchText']}
- />
+ <ClassNames>
+ {({ css: popupCss }) => (
+ <Select
+ css={css`
+ width: 100%;
+ `}
+ // the popup portals to document.body, out of the css prop's
+ // scope, so the grouped-option styles ride along on its root
+ classNames={{
+ popup: {
+ root: popupCss`
+ .ant-select-item.ant-select-item-group {
+ padding-left: ${theme.sizeUnit}px;
+ font-size: ${theme.fontSize}px;
+ }
+ .ant-select-item-option-grouped {
+ padding-left: ${theme.sizeUnit * 3}px;
+ }
+ `,
+ },
+ }}
+ aria-label={t('Select color scheme')}
+ allowClear={clearable}
+ onChange={onChange}
+ placeholder={t('Select scheme')}
+ value={currentScheme}
+ showSearch
+ getPopupContainer={triggerNode =>
Review Comment:
Added `ColorSchemeSelect.test.tsx`: renders the real component inside an `.ant-modal-container` and asserts the popup lands under it, plus one outside a modal asserting it lands under `document.body`. Not run locally, so CI is the first real run.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org