JSFiddle - React, Tailwind, and code Playground
HTML
<input id='qwerty' type="text">
<script>
var input = document.body.children[0];
input.oninput = function() {
var el=document.getElementById('qwerty');
el.focus();
el.setSelectionRange(el.value.length,el.value.length);
};
</script>