Initial focus in a date field does not select the text nor does it have a selectAll method
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
If you have a DateField and focus it, the date string will not be selected. This also applies to TextInput, but for TextInput there's a selectAll method.
Could you automatically select the text for a focused date field or implement a selectAll method for DateField. If you tabulate out of a date field and tabulate back, the text wil automatically be selected, so why not for the initial focus?
import java.time.LocalDate;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.DateField;
import com.vaadin.ui.UI;
public class ParsableDateFieldTestUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
DateField dateField = new DateField();
dateField.setValue(LocalDate.now());
dateField.focus();
setContent(dateField);
}
}
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 with DateField and the provided ParsableDateFieldTestUI entry point, then compare its initial focus behavior with TextInput's selectAll behavior. Confirm the expected behavior for initial focus and focus after tabbing, and consider the issue complete when the date text is selected or DateField exposes equivalent selectAll behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100