Akryum / floating-vue

💬 Easy tooltips, popovers, dropdown, menus... for Vue
https://floating-vue.starpad.dev/
MIT License
3.28k stars 335 forks source link

Doesn't work on hover w/ disabled elements #987

Closed goulashify closed 11 months ago

goulashify commented 12 months ago

Hi,

Thanks for all the work, floating-vue works out great for us!

Context I'm using Dropdown w/ a component that can be disabled, and I'm using hover as a trigger.

Need I'd like to be able to use hover as a trigger, even with disabled inputs. Since disabled inputs don't fire mouseenter and mouseleave events, this is not possible right now.

Recommendation I'd recommend listening to pointerenter and pointerleave events, as these are fired even when buttons are disabled.

POC See here an example of my use-case, and a comparison between the pointer events, note how pointer events keep firing even after the button is disabled.

Akryum commented 11 months ago

I still see the events on the disabled button: image.png

goulashify commented 11 months ago

Ouch. This may be platform dependent. I think there is not much to do about this (on the library level), given how inconsistently this is implemented across browsers.

@Akryum: OK with closing this?

I see this on MacOS 13.5.2 w/ Chrome Version 111.0.5563.64 (Official Build) (arm64) – fires pointer on disabled:

image

On the same platform w/ Safari – don't fire anything on disabled:

image

On the same platform w/ Firefox (117.0.1) – fires both on disabled:

image
Akryum commented 11 months ago

I guess the best way is to wrap the input with a div