2FA: close recovery-codes modal on Enter (0.22.1)#42
Merged
Conversation
The recovery-codes dialog (shown once after enabling 2FA) had no
keyboard shortcut for its "Done" button, unlike the enrollment
("2FA check") modal where Enter on the code input submits.
Add an onKeyDown handler to the recovery-codes DialogContent so
Enter calls preventDefault() (also suppressing the default
Enter-activation of whichever button is focused, e.g. Copy) and
closes the dialog — equivalent to clicking Done. Mirrors the
enrollment modal's existing pattern.
Bump version 0.22.0 -> 0.22.1 (PATCH).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onKeyDownhandler on the recovery-codesDialogContent: Enter callspreventDefault()(which also suppresses the default Enter-activation of whichever button is focused, e.g. Copy) and clears the codes state to close. Mirrors the enrollment modal's existing pattern.Why
The recovery-codes dialog had no keyboard shortcut for its primary action; users had to click Done. This makes the keyboard UX consistent with the other 2FA modal.
Version
Bump
0.22.0→0.22.1(PATCH — frontend-only UX tweak).Testing
npm run buildindocker/card/admin-ui/passes (frontend-only change; no FE test runner).🤖 Generated with Claude Code