question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Events not fired on a child component

See original GitHub issue

Hello,

Version: Vue 2.0.0-rc.3 Repro link: https://jsfiddle.net/p9mcn2tp/2/

When an @click event is attached to a child component directly, the event is forgot. But when the component is not the root, and the event is attached to the wrapper element, it works.

Uncomment the template line in the repro link, to see the workaround: the @click is on a wrapper div.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fnlctrlcommented, Aug 25, 2016

use .native modifier when using v-on on components. <foo @click.native="doSomething"></foo>

0reactions
chrisvfritzcommented, Nov 6, 2016

This unfortunately isn’t something the migration helper can catch, but I’ll look into adding a second reference to the guide.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Child component event emitter not fired in parent
I have problem with output emitter not working in parent component. It is working inside child component but not triggerred in parent. It...
Read more >
LWC child can't fire event at its parent in community
When clicked, the whole flow still works but does not reach the parent method. Could it be that the parent component is missing...
Read more >
Parent not catching events fired in child component-Vue.js
[Solved]-Parent not catching events fired in child component-Vue.js ... The solution I ended up finding is to fire all events in the root...
Read more >
JavaScript: Preventing Parent Event When Child Event Is ...
An issue I came across while setting up my Vacation component's event handlers was that when I clicked on a child event trigger,...
Read more >
Event Bubbling and Event Catching in JavaScript and React
Once an inner child element's event is called, all elements above/below it will also be called (bubbling/capturing).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found