TextField should have an option to select all text on click
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by @hannuvaadin
There are plenty of use cases, eg. search forms, where a user needs to quickly enter and re-enter text into a textfield. Selecting the text every time with a double or triple click can be tedious and tabbing is not always an option (due to design or user behavior).
In these cases it would be an improvement in usability, if a TextField component could select its contents on mouse focus, just like happens when tabbing.
Although this can already be achieved with a server side method, it would be better to eliminate the round-trip altogether and let the developer toggle component's client side behavior in advance with a suitable method – for example tf.setSelectAllOnClick(true).
Imported from https://dev.vaadin.com/ issue #6240
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TextField component and its client-side mouse-focus and text-selection behavior; compare it with the selection that occurs when tabbing. Done means developers can opt in to selecting all contents on mouse focus without a server round trip.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100