Closed
Description
DOM Testing Library
version: 6.12.0node
version: 13.7.0npm
(oryarn
) version: 6.13.6
Relevant code or config:
Component:
export default function App() {
return (
<label>
Select me:
<select>
<option value="1">first</option>
</select>
</label>
);
}
Test:
test('click select', function () {
let { getByRole } = render(<App/>)
fireEvent.click(getByRole('listbox'))
})
What you did:
Simulated a click on a <select>
element that is inside a <label>
element.
What happened:
Get Maximum call stack size exceeded
.
Reproduction:
https://codesandbox.io/s/eloquent-pike-7uw1h
Problem description:
When clicking a select (or possibly input) element which is inside a label, the code is thrown into an infinite loop, which shouldn't happen.
Suggested solution:
Metadata
Metadata
Assignees
Labels
No labels