I know this is an old topic, and I’m sure you want this to not lose focus from a re render, a good way around this is to have the input field in a child component and the onchangetext logic in a parent component which will avoid the losing focus problem that still exists as of today.