When I change a value in an input field, (58.10) to (58.1), the cursor goes behind 5 as soon as I remove "0". I expect it to be beside "1".
React:
// Props
var data = [
{unit_amount: 58.10, id: 1},
{...},
{unit_amount: 25.99, id: 3},
]
_valueChange(i, e){
e.preventDefault();
var obj = this.props.data;
var num = obj.find(p => i === p.id);
num.unit_amount = e.target.value;
},
// Render
var lineItems = this.props.data.map(function(l){
return(
<tr key={l.id}>
<input type="number" value={l.unit_amount} onChange={this._valueChange.bind(this, l.id)} />
</tr>
)
})
Value changes ok but the cursor (the "pipe") goes to the extreme left once I hit the backspace button once. Any ideas?