fix(modal): let password managers autofill the confirmation password

Closes #9963

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras BacsaiandClaude Opus 5.5 committed 2026-10-27 17:11:07 +01:00
1 parent c6b52a1d36
commit 67673525a8
2 files changed
+15 -7

No files matched your search

@@ -369,13 +369,17 @@
class="block text-sm font-medium text-gray-700 dark:text-gray-300">
Your Password
</label>
<form @submit.prevent="false" @keydown.enter.prevent>
<input type="text" name="username" autocomplete="username"
value="{{ auth()->user()->email }}" style="display: none;">
<input type="password" id="password-confirm-{{ $passwordConfirm }}"
x-model="password" class="w-full input" placeholder="Enter your password"
autocomplete="current-password">
</form>
{{-- Add the field when this step shows: password managers do not detect a hidden field that becomes visible. --}}
<template x-if="step === 3">
<form @submit.prevent="false" @keydown.enter.prevent>
<input type="text" name="username" autocomplete="username"
value="{{ auth()->user()->email }}" style="display: none;">
<input type="password" id="password-confirm-{{ $passwordConfirm }}"
x-model="password" x-init="$nextTick(() => $el.focus())"
class="w-full input" placeholder="Enter your password"
autocomplete="current-password">
</form>
</template>
<p x-show="passwordError" x-text="passwordError" class="mt-1 text-sm text-red-500">
</p>
@error('password')
+4
View File
@@ -38,7 +38,11 @@ it('lets a user delete their own account from the profile page', function () {
->screenshot(filename: 'delete-account-modal')
->fill('[x-model="userConfirmationText"]', 'leaving@example.com')
->screenshot(filename: 'delete-account-confirm-text')
// Password managers detect fields when they are added or focused, not when a hidden one shows.
->assertScript('() => document.querySelector(\'input[type="password"][x-model="password"]\') === null', true)
->click('button:visible:has-text("Continue")')
->wait(0.3)
->assertScript('() => document.activeElement?.matches(\'input[type="password"][x-model="password"]\')', true)
->fill('[x-model="password"]', 'password')
->screenshot(filename: 'delete-account-password');