-
Notifications
You must be signed in to change notification settings - Fork 146
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
Remove disableTouchKeyboard and forced focus #78
Comments
In order for keyboard operation to work, the input field has to be focused. If the focus is not moved back to the input field there, it goes to Also, to prevent the input filed from losing focus by other than user's intention, that listener function is added to the capture phase of the input field's click event so that it runs before all other on-click stuff is executed. (#21, #47) export function onClickPicker(datepicker, ev) {
if (ev.target.matches('.timepicker') {
// do the timepicker stuff
// ...
} else if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) {
datepicker.inputField.focus();
}
}; You might see the date picker behave unexpectedly if you don't move the focus back to the input field appropriately after time picking is done. As for |
I see, I did not realize it's there for tabulator and overall accessbility. Would you consider editing the function with the option for ignored elements maybe? Or maybe the focus should be triggered only on datepicker action elements as .datepicker-cell and .button? Extending the picker with timepicker or anything other than that would be easier after that, and I can always trigger the focus back to input manually after that. And yeah using |
vanillajs-datepicker/dist/js/datepicker-full.js
Line 1537 in 4843b2f
This line prevents me from extend the datepicker with timepicker for example.
Because everytime I click into the time input, the focus is lost. I'm not even sure what's the purpose of that focus function.
Anyway, I think disabling touch keyboard should be done with
inputmode="none"
, it's a better approachThe text was updated successfully, but these errors were encountered: