vaadin / vaadin/framework

TextField should have an option to select all text on click

Open
#1,393 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.