title: After clicking on the button, the input new value returns to the old value
body: <p>I need advice, I'm doing such an extension JS, but maybe I'm making a mistake in that the app runs on Angular</p>
  <pre><code>var input1 = document.getElementsByClassName(&quot;vypln&quot;)[0];
  
  var enter = new CustomEvent('keyup');
  enter.which = 13;
  enter.keyCode = 13
  
  input1.focus();input1.value=&quot;&quot;;
  document.execCommand('insertText', false, 4);
  input1.dispatchEvent(enter);
  
  document.getElementsByClassName('buttons')[0].querySelector('button').click();
  </code></pre>
  <p>The data is written to the input, ... but after clicking on the button, the old value is set. I want value to stay there and do it.
  Interestingly, if I use this code and then click (mouse / manually) anywhere and then call <code>document.getElementsByClassName('buttons')[0].querySelector('button').click();</code> so it works fine.
  Thank you all for the advice)</p>