Answer the question
In order to leave comments, you need to log in
How to make the event not fire when hovering over Popover?
Hello! There is a component https://codepen.io/EugeneKarmyshkov/project/editor... , I can’t figure out how to make the onMouseLeave event not fire when hovering over Popover. MB can I add some condition to the handleCloseMenu?
Answer the question
In order to leave comments, you need to log in
You can farm something like such a check, we look, if there is a popover in the target, then we do not close the window
const handleCloseMenu = () => {
if (!event.target?.className.includes("your_PopOver_classname or part_of_classname")) {
setAnchorEl(null);
}
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question