Skip to content

Enhancements#83

Merged
btecu merged 5 commits intomasterfrom
burebista
May 1, 2025
Merged

Enhancements#83
btecu merged 5 commits intomasterfrom
burebista

Conversation

@btecu
Copy link
Copy Markdown
Owner

@btecu btecu commented Apr 30, 2025

  • Remove the peer dependency, since npm is a bit strict and complains when using newer ember-source versions
  • Add tests for the clear button
  • Handle input changes
  • Use event.key instead of deprecated event.keyCode
  • Add test for onInput event when typing
  • Update @babel packages

Handle input changes
Use event.key instead of deprecated event.keyCode
@btecu btecu changed the title Remove peer dependency Enhancements Apr 30, 2025
@btecu
Copy link
Copy Markdown
Owner Author

btecu commented May 1, 2025

@ladadeedee went back to onInput since handling from onKeydown is the wrong approach, as it would be very difficult:

  • key is always uppercase, since it's about the key button, not the actual value
  • there's a shift that can be checked for intention but nothing for caps lock
  • CTRL + V / CMD + V, etc., would need to be handled individually, otherwise you'd just append V to the input

https://w3c.github.io/uievents/tools/key-event-viewer.html

@ladadeedee
Copy link
Copy Markdown
Contributor

Using oninput seems to be working for me in this latest iteration. After doing some testing locally, it looks like my suspicion was accurate and change is some reserved, special thing in Ember. If you edit changeInput to be change, then it breaks, as I previously witnessed. I found one or two references to this event from way back in Ember 1 and 2 days. I don't know if this is due to Evented or if it was some Ember object builtin.

Anyway, using oninput is clearly better than doing hacks on keypress, so I think we should move forward with this and close my PR.

@btecu btecu merged commit 430138f into master May 1, 2025
9 checks passed
@btecu btecu deleted the burebista branch May 1, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants