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
- Dominant language
- JavaScript
- Stars
- 177
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
Research direction
Start by locating the `on-key` modifier and the acceptance-test `keyDown` helper; the issue does not name specific files or tests. Compare how each handles `Shift+Enter` versus lowercase input, then verify the reported reproduction with both forms. Done means the two entry points behave consistently or the required casing is documented and enforced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100