devtools-next icon indicating copy to clipboard operation
devtools-next copied to clipboard

Cannot select nested component if parent has @mouseover.stop

Open joelearn opened this issue 1 year ago • 4 comments

If a component has a @mouseover.stop handler defined, no child components can be selected via the devtools components tab. However, it works as expected using the component inspector tool.

Here's a reproduction: https://stackblitz.com/edit/vitejs-vite-j4abqj?file=src%2Fcomponents%2FHelloWorld.vue

joelearn avatar Jun 26 '24 15:06 joelearn

It's might a bug of vite-plugin-vue-inspector

alexzhang1030 avatar Jun 27 '24 04:06 alexzhang1030

Just using vite-plugin-vue-inspector on its own seems to work fine. Try it here: https://stackblitz.com/edit/vitejs-vite-7ujp2h?file=src%2FApp.vue

Do both ways of selecting a component use this plugin?

joelearn avatar Jul 14 '24 12:07 joelearn

We need to find a way to force ignore stopPropogation

alexzhang1030 avatar Jul 15 '24 04:07 alexzhang1030

So after a little digging around, vite-plugin-vue-inspector uses mousemove for highlighting components. This can be replicated by adding @mousemove.stop to a component, which will then stop the highlighting of nested components. See: https://stackblitz.com/edit/vitejs-vite-cufj5x?file=src%2Fcomponents%2FHelloWorld.vue

We could have devtools-next use mousemove to be consistent with vite-plugin-vue-inspector, but going with the suggestion by @alexzhang1030 would be more robust.

joelearn avatar Jul 15 '24 11:07 joelearn