what i use:react 18,antd 5.12.8,typescript 5.0.2
what is my problem: I set Popover's trigger as hover,but when i input,moving the mouse to panel of choosing word ,it disappeard unexpectly reproduce:codesandbox
I tried to solev it by eventListener,but failed.
I expect when I hover to panel of choosing words,it won't disappear.and only disappear when I leave the popover
You do not have to use this much logic for the action you want to perform. Here is a simplified version of your code:
In the code the
onOpenChangeprop uses thehandleOpenfunction whenever thePopoveris hovered as we have used atriggerofhoverfor it. Along with that theopenprop value is set to theboolean openwhich is used along everytime we hover over the button.Output :