This decimal-related behavior is apparently not a flaw in Google Chrome.
Issue 44116: input type=number won't accept decimals
This issue is marked 'WontFix' and the behavior seems to be standards compliant. Included in the issue is a fix: specify the step attribute of the input. In Chrome, the default value of 'step' is '1', meaning that it only accepts integer input. If 'step' is set to 'any', the field allows decimal input.
So, to summarize:
This is bad, but works in Firefox:
<input type='number'
name='amount' />
This is better for Chrome:
<input type='number'
step='any'
name='amount' />
No comments:
Post a Comment