diff --git a/src/components/feedback/Popover.tsx b/src/components/feedback/Popover.tsx index f92bb91d3..b845f11ea 100644 --- a/src/components/feedback/Popover.tsx +++ b/src/components/feedback/Popover.tsx @@ -255,7 +255,7 @@ export default function Popover({ data-testid="popover" data-component="Popover" > - {children} + {open && children} ); } diff --git a/src/components/feedback/test/Popover-test.js b/src/components/feedback/test/Popover-test.js index b7b006ef3..090673cf1 100644 --- a/src/components/feedback/test/Popover-test.js +++ b/src/components/feedback/test/Popover-test.js @@ -18,18 +18,17 @@ function TestComponent({ children, ...rest }) { Anchor element - {open && - (children ?? ( - <> - Content of popover - - - ))} + {children ?? ( + <> + Content of popover + + + )} ); diff --git a/src/components/input/Select.tsx b/src/components/input/Select.tsx index 6735a85f7..87073887b 100644 --- a/src/components/input/Select.tsx +++ b/src/components/input/Select.tsx @@ -467,10 +467,9 @@ function SelectMain({ aria-multiselectable={multiple} aria-labelledby={buttonId ?? defaultButtonId} aria-orientation="vertical" - data-listbox-open={listboxOpen} onScroll={onListboxScroll} > - {listboxOpen && children} + {children} diff --git a/src/components/input/test/Select-test.js b/src/components/input/test/Select-test.js index 20782770a..40cad6f4c 100644 --- a/src/components/input/test/Select-test.js +++ b/src/components/input/test/Select-test.js @@ -79,7 +79,7 @@ describe('Select', () => { const toggleListbox = wrapper => getToggleButton(wrapper).simulate('click'); const isListboxClosed = wrapper => - wrapper.find('[role="listbox"]').prop('data-listbox-open') === false; + wrapper.find('Popover').prop('open') === false; const openListbox = wrapper => { if (isListboxClosed(wrapper)) {