You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a real browser, when I select text in the "Some text" element, the selection is visible until the mouse-button is released. Then, the mouse-release triggers a "click" event which. The event-handler is invoked, the input-field is focused.
This causes the selection to be removed.
Actual behavior
The in the test-code the click is triggered as in the browser. The input-element is focused.
But the selection is not removed. window.getSelection.toString() still returns the selected string "ome tex"
Reproduction example
https://codesandbox.io/p/devbox/ykz7x2?file=%2Fsrc%2FrenderApp.test.js
Prerequisites
with javascript
Expected behavior
In a real browser, when I select text in the "Some text" element, the selection is visible until the mouse-button is released. Then, the mouse-release triggers a "click" event which. The event-handler is invoked, the input-field is focused.
This causes the selection to be removed.
Actual behavior
The in the test-code the click is triggered as in the browser. The input-element is focused.
But the selection is not removed.
window.getSelection.toString()
still returns the selected string "ome tex"User-event version
14.5.2
Environment
Dependencies of the reproduction example
dependencies:
@testing-library/dom 8.12.0
@testing-library/jest-dom 5.16.3
@testing-library/user-event 14.5.2
devDependencies:
@vitejs/plugin-react 4.2.1
husky 4.3.8
jsdom 24.0.0
lint-staged 10.5.4
prettier 1.19.1
vite 5.1.1
vitest 1.4.0
Additional context
No response
The text was updated successfully, but these errors were encountered: