Hier ist mein Code:
Code: Select all
import { tick } from "svelte";
import { PinInput } from "bits-ui";
let pinInputRef: InstanceType;
let isPinVisible = $state(false);
async function handleSubmit(e: SubmitEvent) {
e.preventDefault();
if (!isPinVisible) {
isPinVisible = true;
await tick();
// Find and focus the first PIN input after it becomes visible
const firstInput = document.querySelector('[data-pin-input-input]') as HTMLInputElement;
firstInput?.focus();
}
}
bind:this={pinInputRef}
enterkeyhint="go"
autocomplete="one-time-code"
class="grid grid-cols-6 gap-2 w-full max-w-lg mx-auto text-lg font-semibold text-neutral-500"
>
{#each Array(6) as _}
{/each}
{isPinVisible ? 'Verify' : 'Continue'}
Wie kann ich meinen Code so ändern, dass iOS erkennt die PinInput-Felder für das automatische Ausfüllen von OTP? Wenn die versteckte Eingabe das Problem verursacht, gibt es eine Problemumgehung, damit das automatische Ausfüllen funktioniert, während die PinInput-Komponente von BitsUI verwendet wird?