From c87cefbb56e045cfd384ef43ff3c9806fdca81ca Mon Sep 17 00:00:00 2001 From: Enzo Martellucci <52219496+EnxDev@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:52:37 +0200 Subject: [PATCH] fix(select): ensure filter dropdown matches input field width (#38886) (cherry picked from commit 41d401a879e58ccb2aa3ec195646d2485b4b986d) --- .../src/components/Select/Select.test.tsx | 32 +++++++++++++++++++ .../src/components/Select/Select.tsx | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.test.tsx index e0383d82558..d7c00084d92 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.test.tsx @@ -915,6 +915,38 @@ test('"Select all" does not affect disabled options', async () => { expect(await findSelectValue()).not.toHaveTextContent(options[1].label); }); +test('dropdown takes full width of the select input for multi select', async () => { + render( +
+ +
, + ); + await open(); + const dropdown = document.querySelector( + '.ant-select-dropdown', + ) as HTMLElement; + expect(dropdown).toBeInTheDocument(); + const widthValue = parseInt(dropdown.style.width, 10); + expect(Number.isNaN(widthValue) || widthValue === 0).toBe(true); +}); + test('does not fire onChange when searching but no selection', async () => { const onChange = jest.fn(); render( diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx index 8fb112df7d1..42c94296143 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx @@ -776,7 +776,7 @@ const Select = forwardRef( options={visibleOptions} optionRender={option => {option.label || option.value}} oneLine={oneLine} - popupMatchSelectWidth={selectAllEnabled ? 168 : true} + popupMatchSelectWidth css={props.css} dropdownAlign={DROPDOWN_ALIGN_BOTTOM} {...props}