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

onClickOutside with teleport #2287

Closed
4 tasks done
mokone91 opened this issue Oct 3, 2022 · 4 comments
Closed
4 tasks done

onClickOutside with teleport #2287

mokone91 opened this issue Oct 3, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@mokone91
Copy link

mokone91 commented Oct 3, 2022

Clear and concise description of the problem

Hi!
I have a Modal with onClickOutside, I render select control which uses teleport to show dropdown content(to allow dropdown to overflow modal/any other overflow hidden wrapper) but when i click to dropdown content click outside it triggered as content rendered in body

Is there any solution exept to filter teleports on each onClickOutside usage?

Suggested solution

looking for solution

Alternative

No response

Additional context

No response

Validations

@mokone91 mokone91 added the enhancement New feature or request label Oct 3, 2022
@carl1498
Copy link

carl1498 commented Oct 10, 2022

same here, there's currently an ignore option for onClickOutside but it's currently only in the core and is not yet available for the components. Hope we could have it there too.

https://github.com/vueuse/vueuse/releases/tag/v7.6.0
#1205

@jd-solanki
Copy link
Contributor

You can use ignore as we did in the Anu framework here.

In your case, you can assign template ref to the dropdown and add it to ignore list.

I hope this will resolve your issue.

@stale
Copy link

stale bot commented Dec 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2022
@sibbng
Copy link
Member

sibbng commented Dec 20, 2022

@mokone91 I would suggest you create a wrapping function in this situation. When #2439 is merged, you can also add selector strings in ignore option.

@carl1498 We've added support passing options in OnClickOutside component. But at the moment ignore option only accepts HTMLElement. It may be tricky to pass ignored elements through the component if you are working in SSR environment. #2439 will make this easier by adding selector string support for ignore option.

@sibbng sibbng closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants