I want to manage the value of a
state (to make custom validations, so I won't use bind:value
) to pass into my input, but the value displayed in the input is not the value I have in the a
state, why happend that?
<script lang="ts"> let a = ""; const onChange = (e: any) => { const nv = e.target.value; if (nv.length <= 4) { a = nv; } };</script><div>value:{a}</div><input type="text" value={a} on:input={onChange} />