ngx-popper icon indicating copy to clipboard operation
ngx-popper copied to clipboard

Is it possible to intercept hideOnClickOutside?

Open juona opened this issue 4 years ago • 3 comments

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?

juona avatar Apr 22 '20 14:04 juona

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

tonysamperi avatar Sep 15 '20 16:09 tonysamperi

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.

juona avatar Sep 16 '20 13:09 juona

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

tonysamperi avatar Sep 16 '20 13:09 tonysamperi