Andarist / Andarist/use-onclickoutside

Clashes with mouse down events creating the element

Aperta
#9 2 commenti 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
496
Fork
27
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It seems like one of the main use cases for this library is creating modals / popups / etc when a button is pressed, but if you happen to use the `onMouseDown` event handler to trigger that behaviour, `onClickOutside` will immediately trigger its own handler.

I've created a very simple sandbox to demonstrate this: https://codesandbox.io/s/musing-johnson-h8qhf

The expected behaviour is that clicking any of those buttons should display the extra `div`, and, once it is displayed, clicking anywhere outside the div should hide it. However, the first button triggers the extra `div` to be added and then immediately removed.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.