fix(parental-lock): tell Enter in the PIN field from a click on Save

Moving on to an empty repeat was decided by document.activeElement in
submit(). WebKit does not focus a clicked button, so a click on Save
with the PIN field focused looked like Enter: focus moved and no error
showed. The advance is now a keydown.enter handler on the PIN field
that prevents the submission, and submit() refuses an empty repeat on
every path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-10-01 06:43:33 +02:00
1 parent 9d1f3d34fc
commit 24fcea999d
5 files changed
+52 -9

No files matched your search

@@ -110,7 +110,16 @@ test.describe('Electron parental-lock PIN dialog', () => {
'new-password'
);
// Enter after the PIN moves on to the empty repeat; Save
// with the repeat still empty is refused.
await pin.fill(PIN);
await pin.press('Enter');
await expect(confirm).toBeFocused();
await expect(mismatch).toBeHidden();
await submit.click();
await expect(mismatch).toBeVisible();
await expect(dialog).toBeVisible();
await confirm.fill(PIN.slice(0, 3));
await expect(mismatch).toBeHidden();
await expect(confirm).toHaveAttribute('aria-invalid', 'false');