Attaching DOM events not working
See original GitHub issueI am trying to attach DOM events to the rendered nodes but it is not working.
I have used the following syntax:
function render() {
return h('div', {
style: {
height: "100px",
width: "100px",
background: "#CCC"
},
"ev-click": function () {alert('hi');},
}, "Hello World!");
}
What am I missing here?
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >Attaching click event to a JQuery object not yet added to the ...
By the way, I'm working with OpenLayers, and the DOM object that I'm appending the button to is an OpenLayers.FramedCloud (Which is not...
Read more >Handling Events :: Eloquent JavaScript
This works for most types of events—you can attach a handler through the attribute whose ... Like the focus-related events, loading events do...
Read more >Do not attach listeners for DOMContentLoaded after it already ...
Look at document.readyState . If it says "interactive" then the DOMContentLoaded event has already fired. It could be either loading or interactive or...
Read more >.bind() | jQuery API Documentation
A string containing one or more DOM event types, such as "click" or "submit ... One handy use of this parameter is to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks! I had not found the on* syntax in the documentation or may have missed it.
@staltz “building a custom bubbling/catching system” is exactly dom-delegator.
The bit that needs decoupling is how to dispatch to the ev-foo handlers without coupling to dom-delegator
What we have done is coupled to
ev-store( https://github.com/Raynos/ev-store ) which can then be read from my any bubbling / delegation system.Matt-Esch might use that to do bubbling / delegation at the “component” boundary instead of at the “global” boundary.