Merge pull request #3155 from mervekaraman/master
Password Hide/Show fixed
This commit is contained in:
commit
c9e31569e2
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue