sheinsight / shineout

高性能React组件库

Home Page:https://shine.wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can Popover cancel the mouseEnterDelay timer on mouse click?

Malvineous opened this issue · comments

Hello!

Is it possible to make the Popover component cancel the mouseEnterDelay timer on a mouse click?

Here is an example of my problem: https://codesandbox.io/s/billowing-wood-y1rtv

If you click the button quickly and move the mouse away, the Popover should not appear. But because of the browser dialog that appears, when you close the dialog the Popover appears anyway. In my example it is difficult to click the button and not have the Popover appear.

I would like to make it so that when you click on the button, the Popover's mouseEnterDelay timer is cancelled so that the popover will not appear.

Is this possible?

Many thanks!

click and hover may appear together in the scene, we will consider adding an attribute to achieve your function.
Or you can use visible and onVisibleChange to control the display.

@Malvineous Hi friends, long time no see. Support for this feature has been added in 1.6.5-rc.18.

<Popover clickToCancelDelay mouseEnterDelay={500} {...otherProps} />

You can use clickToCancelDelay prop to cancel popup before delay comes.

Sorry for the late reply! I have just tested this with 1.6.5 and it has solved my problem, many thanks!