developit / developit/tags-input
Keyboard events created with DOM don't trigger
- Dominant language
- JavaScript
- Stars
- 333
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
There is a [known bug with Webkit](https://bugs.webkit.org/show_bug.cgi?id=16735) where KeyboardEvents created by the DOM have keyCode and charCode of 0, thus preventing us from manually triggering 'change' or 'input' events with this library.
I have managed to create a workaround by triggering a 'blur' Event on the input, but ultimately triggering the KeyboardEvent with a Tab or Comma would have been a better way of interacting.
Native JavaScript, particularly JS packages, is not my forte but I'm sure a simple solution to this issue would be to modify the event listeners to work off Keys rather than KeyCodes.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the WebKit behavior described in the issue: DOM-created KeyboardEvents have keyCode and charCode set to 0. Review the library's event listeners and investigate whether they can use keys instead of key codes, then verify that Tab or Comma can trigger the intended input or change behavior without relying on blur.
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
- 35/100