Hello, I don't understand why alpine ajax is replacing fine this fragment:
<form
id="totp-1"
x-target method="post"
action="/totp/1"
x-data x-ref="digits"
>
<input
id="digit-1"
name="digit-1"
type="text"
maxlength="1"
@input="if ($el.value) $focus.within($refs.digits).next()"
@keyup.enter="$el.form.submit()"
/>
</form>
But it breaks and do full reload when the server returns this:
<form
id="totp-1"
x-target method="post"
action="/totp/1"
x-data x-ref="digits"
>
<input
id="digit-1"
name="digit-1"
type="text"
maxlength="1"
@input="if ($el.value) $focus.within($refs.digits).next()"
@keyup.enter="$el.form.submit()"
/>
<input
id="digit-2"
name="digit-2"
type="text"
maxlength="1"
@input="if ($el.value) $focus.within($refs.digits).next()"
@keyup.enter="$el.form.submit()"
/>
</form>
And this will work again:
<form
id="totp-1"
x-target method="post"
action="/totp/1"
x-data x-ref="digits"
>
<input
id="digit-1"
name="digit-1"
type="text"
maxlength="1"
@input="if ($el.value) $focus.within($refs.digits).next()"
/>
<input
id="digit-2"
name="digit-2"
type="text"
maxlength="1"
@input="if ($el.value) $focus.within($refs.digits).next()"
/>
<button style="display: none;"></button>
</form>
Can I debug this behavior somehow? I don't see any errors in console.
Hello, I don't understand why alpine ajax is replacing fine this fragment:
But it breaks and do full reload when the server returns this:
And this will work again:
Can I debug this behavior somehow? I don't see any errors in console.