vue-on-click-outside icon indicating copy to clipboard operation
vue-on-click-outside copied to clipboard

Fix a bug with mouseenter not being fired

Open tobz-nz opened this issue 7 years ago • 4 comments

In some cases when the target element is dynamically shown and the mouse is already over it - the mouseenter is not triggered. mouseover is though, so this change fixes the issue.

tobz-nz avatar Jan 29 '18 23:01 tobz-nz

hmm. could you provide me with a link, that reproduces the issue? I’m hesitant to use mouseover because it fires once for every child element. maybe it’s better to use the .contains() check from the static strategy to fix this specific bug, but I have to look into that.

kmohrf avatar Jan 30 '18 00:01 kmohrf

hmm I don't have a public link with an example.

In my case I have a avatar image and when you click on it a filepicker modal opens. The file picker opens above the avatar image so your mouse is already over it hence no mouseenter event is fired.

If I get time I can possibly mock something up on js fiddle if you need an example.

is the event firing for child elements a big problem? its a lightweight event - I guess it could cause a light performance hit if you have a lot of children and are mouse all over the place very quickly...

maybe instead of hard coding the event we make it a configurable option - defaulting to mouseenter. Would that work for you?

What's the static strategy? I'm unfamiliar with that term.

tobz-nz avatar Jan 30 '18 01:01 tobz-nz

Oh I just noticed the dynamic/static strategy functions - that's what you meant.

tobz-nz avatar Jan 30 '18 01:01 tobz-nz

Just as a heads up: I’ll try to get back to your issue at the end of the week :)

kmohrf avatar Jan 31 '18 14:01 kmohrf