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

hideTimepicker event after choosing option with mouse #650

Open
imbrish opened this issue Nov 23, 2017 · 0 comments
Open

hideTimepicker event after choosing option with mouse #650

imbrish opened this issue Nov 23, 2017 · 0 comments

Comments

@imbrish
Copy link

imbrish commented Nov 23, 2017

When option is selected by clicking, the hideTimepicker event will fire before the dropdown is actually closed, as seen here:

if (_selectValue(self)) {
self.trigger("hideTimepicker");
list.on("mouseup.timepicker click.timepicker", "li", function(e) {
list.off("mouseup.timepicker click.timepicker");
wrapped_list.hide();
});
}

However when using api method hide, the same event will fire only after dropdown is closed:

list.hide();
self.trigger("hideTimepicker");

Moreover we could actually "cheat" and after selecting option keep the button pressed, move cursor outside the dropdown and release it. That would cause event to fire, without actually closing the dropdown! Could be confusing :)

I would suggest moving the trigger method into mouseup.timepicker click.timepicker handler, or doing it bootstrap style with hiding and hidden events, former fired right before and latter right after dropdown is hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant