Closed
Description
-
@testing-library/user-event
version: 7.29.6 (latest at the time of writing) -
Testing Framework and version: n/a
-
DOM Environment: Tested in Chrome/Safari/Firefox
Steps to reproduce
- Open this CodeSandbox: https://rvh87.csb.app/
- Click on "click with user-event" button
- You will see "blur" logs in the console
- Click on "test button" directly
- There are no "blur" logs in the console
Code Example:
Codesanbox source: https://codesandbox.io/s/rvh87
<button class="to-test">
<span>test button</span>
</button>
userEvent.click(screen.getByText("test button"));
Suggested solution:
The library should check if the click target is inside already focused container and should not blur it.