Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a clear button for the DateTimePicker #7698

Open
jcgueriaud1 opened this issue Aug 27, 2024 · 1 comment
Open

Add a clear button for the DateTimePicker #7698

jcgueriaud1 opened this issue Aug 27, 2024 · 1 comment
Labels
enhancement New feature or request needs design Design is needed vaadin-date-time-picker

Comments

@jcgueriaud1
Copy link
Contributor

Describe your motivation

The components like DatePicker and TimePicker have a clear button functionality.
But the DateTimePicker does not have a clear button.

Describe the solution you'd like

I would like a clear button that clears the field.
Maybe something like this:
image

Describe alternatives you've considered

One alternative solution is to set the clear button on the internal TimePicker and DatePicker.
It doesn't require a new design but it doesn't properly clear since it clear only half of the value.

mainField.getChildren()
        .filter(c -> c instanceof HasClearButton)
        .map( c -> (HasClearButton) c)
        .forEach(d -> d.setClearButtonVisible(true));

We could also create a external button that clears the 2 fields.

Additional context

No response

@rolfsmeds
Copy link
Contributor

One question that comes to mind here is what pressing Esc in either subfield should do. In other fields it acts as a shortcut to the clear action, clearing the field's value entirely. Should it in this case clear just the currently focused subfield, or both subfields?

@yuriy-fix yuriy-fix added needs design Design is needed enhancement New feature or request labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs design Design is needed vaadin-date-time-picker
Projects
None yet
Development

No branches or pull requests

3 participants