Merge pull request #3155 from mervekaraman/master

Password Hide/Show fixed
This commit is contained in:
Cüneyt Şentürk 2024-04-26 14:08:10 +01:00 committed by GitHub
commit c9e31569e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,8 @@
<div x-data="{ showPassword: false}">
<div x-data="{ showPassword: false, password: '' }" x-cloak>
<input
type="password"
x-bind:type="showPassword ? 'text' : 'password'"
x-model="password"
name="{{ $name }}"
id="{{ $id }}"
class="relative w-full text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white disabled:bg-gray-200 focus:outline-none focus:ring-transparent focus:border-purple"
@ -20,8 +21,9 @@
@endif
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
/>
<button type="button" class="absolute inset-y-0 top-8 right-0 flex items-center pr-3 text-gray-400 " x-on:click="showPassword = !showPassword">
<button type="button" class="absolute inset-y-0 top-7 right-0 flex items-center pr-3 text-gray-400 "
x-on:click="showPassword = !showPassword" x-show="password">
<span x-show="!showPassword" class="material-icons-outlined text-gray-500 text-lg">visibility_off</span>
<span x-show="showPassword" class="material-icons-outlined text-gray-500 text-lg">visibility</span>
</button>
</div>
</div>