Suggested Fix: Replace the event "keyup" with "keydown" for Compatibility with Chinese IMEs

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start by searching the JavaScript sources for keyup handlers used by the AlertifyJS prompt and inspect how Enter is handled during form submission. Replace the relevant event usage with keydown as described, then verify that Chinese IME character selection does not submit the prompt while normal keyboard interaction remains usable.

Written by the indexing model from the issue text.

Description

When typing with a Chinese input method editor (IME) on a computer, users select characters using the arrow keys and the enter key. However, in the AlertifyJS prompt window, pressing enter to select a character triggers the form submission. This causes significant inconvenience for users, as shown in the video.

I subsequently replaced all instances of the “keyup” event in the JS file with “keydown,” which perfectly resolved the issue without affecting usability. This modified version has already been deployed to the website “Hearty Journal”. Therefore, I suggest that the author consider making this adjustment as well.

https://github.com/user-attachments/assets/110837f6-3a80-448a-9a09-d0b24f9b373a

Dominant language
JavaScript
Stars
2.1k
Forks
294
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MohammadYounes/AlertifyJS

All issues in MohammadYounes/AlertifyJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.