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

can't use outsideClickIgnoreClass with multiple class names #305

Open
orenraz opened this issue Jan 7, 2019 · 9 comments
Open

can't use outsideClickIgnoreClass with multiple class names #305

orenraz opened this issue Jan 7, 2019 · 9 comments

Comments

@orenraz
Copy link

orenraz commented Jan 7, 2019

will be great to be able to pass multiple class names for outsideClickIgnoreClass like:
outsideClickIgnoreClass="class-a class-b".

you can change the function isNodeFound to check for multiple appearance of classes

@Pomax
Copy link
Owner

Pomax commented Jan 7, 2019

can you explain the use case?

@orenraz
Copy link
Author

orenraz commented Jan 7, 2019 via email

@Pomax
Copy link
Owner

Pomax commented Jan 7, 2019

I'm not sure I understand. Are you saying these apps exist inside the modal? If so, clicks will already originate inside the modal and outside clicks shouldn't even be detected (because there are none). If they're not, then why can you not add the outsideclickignore class to both dropdowns' class list? You're not stuck with "one class" for elements, just say <Dropdown1 class="your classes outsideclickignore" ...> and <Dropdown2 class="other stuff outsideclickignore" ...> and now clicks on either of those drop downs won't trigger the outsideclick handler.

@orenraz
Copy link
Author

orenraz commented Jan 7, 2019 via email

@orenraz
Copy link
Author

orenraz commented Jan 7, 2019 via email

@Pomax
Copy link
Owner

Pomax commented Jan 8, 2019

That's a better explanation of the situation. I'm pretty sure that's a valid use case for allowing "one of any" ignore classes rather than just a single fixed string

@miSunLaughing
Copy link

I have the same situation, and I am looking forward to be able to pass multiple class names for outsideClickIgnoreClass.

@Quocnamit
Copy link

Quocnamit commented Sep 13, 2019

Me too. I have the same situation, and I am looking forward to be able to pass multiple class names for outsideClickIgnoreClass.

In UI, we can imagine that some elements are inside their same parent element. but in DOM, they are placed in different places.

@ghost
Copy link

ghost commented Nov 19, 2019

Not for every case, but instead of passing multiple classes to outsideClickIgnoreClass you could try "lifting things up" by wrapping the required elements into a single parent element which you then ignore.

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

4 participants