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 45656928757..6b89561627a 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 a5863d1a6f4..3f5d9cf4bf8 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 @@ -777,7 +777,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}