MrFrankel / ngx-popper

An angular wrapper for popper.js, great for tooltips and positioning popping elements
https://mrfrankel.github.io/ngx-popper/
MIT License
186 stars 37 forks source link

Is it possible to intercept hideOnClickOutside? #136

Open juona opened 4 years ago

juona commented 4 years ago

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 commented 4 years ago

image

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

By the way I just released ngx-popperjs@8.0.3 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 commented 4 years ago

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

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 commented 4 years ago

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...