MohammadYounes / MohammadYounes/AlertifyJS

alertify.confirm() returns OK and not CANCEL when ENTER KEY Pressed and CANCEL is default

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

Nobody has claimed this yet.

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

Description

I am calling "alertify**.confirm()**" with these options:

  • closable: false
  • closableByDimmer: false
  • defaultFocus: "cancel"
  • frameless: false
  • maximizable: true
  • pinnable: true
  • resizable: true
  • title: "A Title

If I don't mouse click the dialog and press ENTER, it response with CANCEL (good).
If I mouse click the anywhere dialog (not a button) and press ENTER, it response with CANCEL (bug). Clicking the dialog should not change the focus.

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.

Research direction

Start by reproducing the issue in an AlertifyJS confirm dialog with defaultFocus set to cancel: press ENTER before and after clicking the dialog background. Trace the focus handling for dialog clicks and keyboard activation. Done means clicking outside the buttons does not change the focused default action, so ENTER consistently triggers CANCEL.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.