Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Add documentation on how to support multiple actions on a single element #2900

Open
myartsev opened this issue May 20, 2017 · 3 comments
Open

Comments

@myartsev
Copy link

I've spent more time than I'm willing to admit in figuring this out, and now it seems so simple:
<a {{action 'foo' on="click"}} {{action 'bar' on="mouseEnter"}} {{action 'baz' on="mouseLeave"}}>...</a>

Can we add some documentation on how to support multiple actions on a single element?
I think the reason this turned out to be such an unnecessary hassle is the amount of outdated information out there on the web today.

I'm thinking this is the best place for it is before the blurb on attaching actions to non-clickable events?
Happy to write it up and send a PR if you guys think it's useful. I imagine I'm not the first or the last person to run into this!

@locks
Copy link
Contributor

locks commented Aug 7, 2017

I think at that point you'd be better off using actions as event handlers, <a onclick={{action 'foo'}} > and such. Can you submit a PR and we'll discuss there?

@acorncom
Copy link
Contributor

@myartsev any thoughts here? Would love to get this added into the guides if you have time for that PR ...

@myartsev
Copy link
Author

My bad, this dropped off my radar.

@locks; can those event handlers be used to handle all types of events? Mouse up, down, etc
If that's the case, why isn't that the suggested way of handling events in the guides?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants