hexonaut / haxe-dom

A cross-platform implementation of the DOM. Built to reduce duplicate code across server and client.
MIT License
46 stars 4 forks source link

Event handling confusion in example #3

Closed cambiata closed 10 years ago

cambiata commented 10 years ago

Thank you, Sam! Now, the HTMLDetailsElement problem is gone in Chrome.

However, I'm a bit confused about the event handling. Even if I make sure that a new Post user is set to - say - Fred, the event is caught seemingly randomly by the two event handlers.

If I click John's "Click me" button, the "Event!" text is sometimes added in Fred's post-message div, sometimes in John's.

(I'm probably missing some fundamental concept thing here, please excuse me if so..!)

J

hexonaut commented 10 years ago

This is the correct behaviour. I just wrote this example up quickly, so it is a little unintuitive. If you look at the event handler code you can see everything is functioning correctly. Feel free to play around with it to get some more intuitive behaviour.