Description
Description
I have a vaadin-text-field
with autoselect
.
When I select a part of the text and switch to another window and back to the browser, all text is selected again.
This is an issue if you are using for example Ditto clipboard tool as pasting focuses the Ditto window and before pasting, the browser is focused again.
The relevant code is in input-control-mixin.
Expected outcome
I would expect the text to only be selected if the field gets the focus in the webapp but not if the browser gets back the focus.
Another posibility would be to select all only if nothing is selected.
Minimal reproducible example
In this screen recording, the First name
has autoselect=true
, while the Last name
has autoselect=false
.
Not that when pasting into First name
from Ditto, the whole text gets selected and overwritten, while it works as expected for Last name
Autoselect.mp4
Steps to reproduce
- Create a vaadin application with a field with "autoselect" set to true
- Focus part of the text
- Switch window and back to the browser
All text is selected again
Environment
Vaadin version(s): Tested with 24.4.14
Browsers
Issue is not browser related