-
Is there a boiler plate example for const hover = useHover(context, { handleClose: customFunction() }) I took a look at the source code for const customFunction = () => {
return { __options: { blockPointerEvents: false } }
} My goal is to hover over an element, and keep the floating window open until a user clicks anywhere but the window. Or, closes it from the floating window itself (that's already implemented). The function above actually achieves my goal (not sure how), but I get the following error
So, I'm clearly missing something. Any ideas? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yeah although it technically works, the assumption is that function createHandler(context) {
return function onMouseMove(event) {
// ...
}
}
// This is an implementation detail, and _should_ be optional
createHandler.__options = { blockPointerEvents: false }; useHover(context, {
handleClose: createHandler
}); |
Beta Was this translation helpful? Give feedback.
-
Got this to work as well after adding
|
Beta Was this translation helpful? Give feedback.
Yeah although it technically works, the assumption is that
handleClose
is only to be used withsafePolygon
right now due to the__options
; but here's how to use it: