mercredi 14 octobre 2015

Binding multiple actions to span using EmberJS

i have a span decorated with a disclosure triangle. When the user clicks on the triangle the span expands and displays its content. For ADA purposes, I would like that span to also expand when the user presses the enter key. Is it possible for this to happen? I've found a few links that say its not supported, but i did find one link that says its possible in more recent versions of Ember: "Multiple actions on element"

But I've not been able to get this to work in 1.13.5. Here's what I have:

{{#if isCollapsed}}
        <span class="control expanded" {{action "expand"}} {{action "expand" on="enter"></span>
    {{else}}
        <span class="control collapsed" {{action "collapse"}}></span>
    {{/if}}

The default action of clicking works, but is not fired when the Enter key is press. Any ideas?




Aucun commentaire:

Enregistrer un commentaire