gnat / surreal

🗿 Mini jQuery alternative. Dependency-free animations. Locality of Behavior. Use one element or arrays transparently. Pairs with htmx. Vanilla querySelector() but better!
https://gnat.github.io/surreal/example.html
MIT License
1.3k stars 26 forks source link

me(event) behavior with children #3

Closed gazpachoking closed 9 months ago

gazpachoking commented 1 year ago

I noticed that the behavior for me(anEvent) returns the event's target. This means that you will often get a child of the element you attached the event handler to (if it has children.) I think maybe returning the currentTarget is the more logical choice, so that you always get the element back that you added the handler to.

gnat commented 1 year ago

Sounds reasonable! Thank you. I'll test this out and make an update in the near future.