DatePicker disable open on focus

Hi there,

Is there a way to tell the DatePicker to not open the calendar when the textfield get focused ?
Can’t figure it out and seems to be a basic need.
I’ve been looking all issues dealing with focus but not related with my question.

Thanks.

There’s probably some hacky way to do that. No API for it, though.

Can you tell why you think you need to prevent it from opening on focus? And I’ll just point out that the calendar does not open when the field is focused using the keyboard (the Tab key).

Feel free to open a new issue about this in GitHub if you think there should be a way to configure the behavior.

The main reason is when the user is filling a form with the TAB key, if the calendar is displayed the user can’t continue to fill the form with the TAB key. The focus is set in the calendar.

I’ve seen that when the datepicker get focused with the TAB key, the calendar doesn’t open but as soon as the user began filling the date, the calendar opens itself.

Not sure if it’s a common use case or not (just responding to my final users wishes!)… I will think about creating a new issue on GitHub.

Thanks for the clarification!

Yeah, that’s true, the calendar will open when you start typing in the field. The behavior is trying to be consistent with combo box, but the additional tab stops within the dropdown break it, like you pointed out. The user will have to press the Enter key to confirm the date and close the calendar, and then they can press the Tab key to move to the next field.

I’m not sure which would be the best default behavior. It seems that it’ll be a compromise in some way in both cases (whether to show the calendar automatically when typing or not).

Yeah, I agree.

Thanks for your reply.

Having said that, it sounds like it should be configurable exactly because of that, so you get to choose the compromises you want to have. So it’s very much okay if you want to open an issue about this in GitHub.

I need component like vaadin 8 InlineDateField.

Is there any way to keep opened the DatePicker.