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
Input field should not lose focus when clicking on picker #85
Comments
I din't think seriously to solve it because it's bootstrap-datepicker behavior. But thunks, this seems like giving me a hint for the solution of #78 |
Okay, thanks for the info. This is something that can also be done in userland, in case someone (like me 😉) does not like the above mentioned vanillajs-/bootstrap-datepicker behavior. |
Sorry, It looks like one of the typos I made made you misunderstand. I meant "I didn't think seriously...", not "I don't think seriously..." So I'm willing to make this change. |
@lubomirblazekcz Could you please do me a favor and check whether the little changes mentioned in the issue description above have any negative impact on your time selector extension here: #25 (comment) ? [Edit]: I think, for a simple test, just adding |
@xdev1 seems to be ok 👍 |
@xdev1 ok maybe not after all, but it can be easily fixed I've created new PR #92 to resolve my issues with timepicker extention I've edited your code a little to work with that change
export function onMouseDownPicker(datepicker, ev) {
if (!ev.target.matches(datepicker.config.focusIgnoredSelector)) {
ev.preventDefault();
}
}
registerListeners(datepicker, [
...
[element, 'mousedown', onMouseDownPicker.bind(null, datepicker)],
...
]); |
Wouldn't the following changes work for your time field extension (I think this should also solve #78)? This is only meant as a just-FYI-alternative solution without the need of an additional config parameter [Edited several times]
|
It looks really odd that the input field loses focus for a short moment when you click somewhere on the picker.
This seems to be easily fixable:
pickerListeners.js
add the following function:In file
Picker.js
import alsoonMouseDownPicker
and register it:@mymth Please let me know what you think of this enhancement. I could prepare a PR if you like.
The text was updated successfully, but these errors were encountered: