The below code only working in web view, but not in mweb browser
onKeyPress={(e) => {
var startPos = e.currentTarget.selectionStart;
if (e.which === 32 && startPos == 0) {
e.preventDefault();
}
}
(function()
{
let inp = document.querySelector('input');
inp.addEventListener('keyup', function(e)
{
e.target.value = e.target.value.trimStart();
});
})();
<input type="text">
If you try to put a space at the start of the text box then it will be removed. In fact any whitespace will.