react-cool-onclickoutside icon indicating copy to clipboard operation
react-cool-onclickoutside copied to clipboard

How can I get this work for a node element that already has a ref

Open Yeran opened this issue 2 years ago • 1 comments

ISSUE DESCRIPTION: I am trying to use the lib to close a modal dialog whenever a click happens outside the modal(on backdrop), but the dialog itself has a ref for its main functionality.

SNIPPET: image

QUESTION: Is there any workaround to get this work for a node element that already has a ref (for the dialog in the given specific case) ?

Yeran avatar Feb 14 '24 11:02 Yeran

Have you tried passing refs in the options? https://github.com/wellyshen/react-cool-onclickoutside?tab=readme-ov-file#use-your-own-ref

avaya-jashmore avatar Jul 23 '24 19:07 avaya-jashmore