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

Dropdown unable to prevent close on click Checkbox Label #145

Closed
seltix5 opened this issue May 17, 2017 · 7 comments
Closed

Dropdown unable to prevent close on click Checkbox Label #145

seltix5 opened this issue May 17, 2017 · 7 comments

Comments

@seltix5
Copy link

seltix5 commented May 17, 2017

hi,
when using :
alertify.confirm().set({'reverseButtons': true}); alertify.prompt().set({'reverseButtons': true});
to set reverseButtons to all popups, for some reason the event to stopPropagation on dropdown click stops work.
Test page :
https://codepen.io/seltix/pen/XRPrwM

@MohammadYounes
Copy link
Owner

Hi,

Thanks for the sample, seems to be related to body element having tabindex="0". A quick fix would be to add tabindex="0" to the label as shown here

In the next update, I'll make tab index be added only when showing the dialog.

Thanks!

@seltix5
Copy link
Author

seltix5 commented May 17, 2017

hi,
wow, dint expect that, why the tabindex on the body affect the click event on the dropdown?

Btw, the fix works, thanks!

@MohammadYounes
Copy link
Owner

Not 100% sure, but seems the click event on none tab-able elements will be fired on the first tab-able element. if none found, it will be fired on the first container that is listening on it :)

@seltix5
Copy link
Author

seltix5 commented May 18, 2017

weird behavior :S thanks ^^

@MohammadYounes
Copy link
Owner

Or may be one of the other libraries are hooking into focus, focusin or focusout events, which gets fired before click event when body has tabindex="0".

@seltix5
Copy link
Author

seltix5 commented May 19, 2017

hi,
i update the codepen to test this : https://codepen.io/seltix/pen/XRPrwM (you need to change the IF state to test this situation)
and for some reason the problem is not the tab-index directly... :/

@seltix5
Copy link
Author

seltix5 commented May 19, 2017

ooooopppss, ignore my previous message, it was a code error on my test, youre correct.
then the event problem must be on the bootstrap library ..

yap, here it is, version without bootstrap and it is working as expected : https://codepen.io/seltix/pen/LygQXx

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

No branches or pull requests

2 participants