adopted-ember-addons / adopted-ember-addons/ember-keyboard

Key sequence specs appear to be case-sensitive in test helpers, but not in `on-key` modifier

Ouverte
#793 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
177
Forks
59
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I was defining an `{{on-key "Shift+Enter" this.someCallback}}` in my app code, which worked fine. But then when I went to make an acceptance test and added `keyDown("Shift+Enter")`, this would not fire the callback.

I tried changing it to `keyDown("shift+enter")` in the test and this still didn't work.

Finally, I made both specify in all lowercase, `{{on-key "Shift+Enter" this.comeCallback}}` in the template and `keyDown("shift+enter")` in the test and now it does trigger the callback.

I know this now and can work around it, but it doesn't seem like intended behaviour to me. It would be ideal if both parts behaved the same, case-insensitive way, but I'd be just as happy if all lowercase were required in both contexts and this were documented/enforced with a warning.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.