I've got an input field(using redux-form):
<input
{...input}
autoFocus
onFocus={(e)=> {
var val = e.target.value;
e.target.value = '';
e.target.value = val;
}}
className={'hinput'}
value={input.value}/>
When the input is focused, it starts typing from the position where you click(right or left from the value). How to force user to start typing from the beginning when the input is focused?
The wrong behavior:
I tried to use the function onFocus
and try to e.target.value=''
to reset the value so it will go to the beginning, but it does not work. Thanks in advance