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

Is it possible to intercept hideOnClickOutside? #136

Open
juona opened this issue Apr 22, 2020 · 3 comments
Open

Is it possible to intercept hideOnClickOutside? #136

juona opened this issue Apr 22, 2020 · 3 comments

Comments

@juona
Copy link

juona commented Apr 22, 2020

Hi! The wrapper works great, thanks for your work. Here's an issue I'd like to solve: I open the popper using a button click. I would like the popper to remain open if I click the same button again and only close if I click anywhere else. How could I achieve that?

@tonysamperi
Copy link

tonysamperi commented Sep 15, 2020

image

@juona use the disabled attribute! When disabled, the ouside click won't close the popper!

By the way I just released [email protected] which now works with Angular8. Will upgrade to Angular 9 and 10 in the next few days...
Demo here => https://tonysamperi.github.io/ngx-popperjs

@juona
Copy link
Author

juona commented Sep 16, 2020

Thanks, but unfortunately that's not what I wanted : ]

  • outside click closes popover = GOOD
  • same button click closes popover = BAD

I wish the popper to remain open if I click the same button that was used to open it in the first place. And close if clicked anywhere else.

@tonysamperi
Copy link

Yeah I had already understood what you need, but I hadn't noticed that the changing disabled attribute also hides the popover...
It seems that you need a very precise solution that you could achieve with a few tricks...

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

2 participants