title: How do I keep the focus on an input, after i click on a button without flickering in Vue 3?
body: <p><strong>Script</strong></p>
  <pre class="lang-js prettyprint-override"><code>const amountRef = ref(null);
  const amount = ref(0.1);
  
  const insertSuggestion = (e, value) =&gt; {
    e.preventDefault();
    e.stopPropagation();
    amount.value = value;
    amountRef.value.focus();
  };
  </code></pre>
  <p><strong>Template</strong></p>
  <pre class="lang-html prettyprint-override"><code>&lt;Suggestion
     class=&quot;...&quot;
     v-for=&quot;suggestion in suggestions&quot;
     :key=&quot;suggestion&quot;
     @click=&quot;insertSuggestion($event, suggestion)&quot;
  &gt;
      {{ suggestion }}
  &lt;/Suggestion&gt;
  &lt;input
     class=&quot;...&quot;
     @keyup.enter=&quot;handleBuy&quot;
     placeholder=&quot;Amount&quot;
     ref=&quot;amountRef&quot;
     v-model=&quot;amount&quot;
  /&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cTCBT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cTCBT.gif" alt="enter image description here" /></a></p>