This commit is contained in:
Mekan1206
2026-05-19 20:17:11 +05:00
parent a40eee7171
commit 9870048a5f
3 changed files with 21 additions and 6 deletions

View File

@@ -36,12 +36,12 @@
<div class="space-y-md flex-grow">
<div class="group relative flex items-center bg-surface-container-lowest border border-outline-variant rounded h-16 px-md transition-all duration-300 focused-input-glow focus-within:border-primary">
<!-- Country Code Selector (Simulated) -->
<button type="button" class="flex items-center gap-xs pr-md border-r border-outline-variant mr-md hover:bg-surface-container-low transition-colors h-10 rounded-sm">
<button type="button" tabindex="-1" class="flex items-center gap-xs pr-md border-r border-outline-variant mr-md hover:bg-surface-container-low transition-colors h-10 rounded-sm">
<span class="font-label-md text-label-md text-on-surface">+993</span>
</button>
<!-- Actual Input -->
<input id="phone-input" name="phone_visual" class="bg-transparent border-none focus:ring-0 w-full font-otp-digit text-otp-digit text-on-surface placeholder:text-outline-variant" placeholder="6X XX XX XX" type="tel" value="{{ old('phone_visual') }}"/>
<input id="phone-input" name="phone_visual" autofocus autocomplete="tel" class="bg-transparent border-none outline-none focus:outline-none focus:ring-0 w-full font-otp-digit text-otp-digit text-on-surface placeholder:text-outline-variant" placeholder="6X XX XX XX" type="tel" value="{{ old('phone_visual') }}"/>
<input type="hidden" name="phone" id="phone-hidden" value="{{ old('phone') }}">
</div>
@@ -73,6 +73,8 @@
const hiddenInput = document.getElementById('phone-hidden');
const form = document.getElementById('phone-form');
input.focus();
input.addEventListener('input', (e) => {
let value = e.target.value.replace(/\D/g, '');
// format: K X XX XX XX