You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as far as I know "number decimal" is completely invalid html. Furthermore, if you put a constraint on the field of say min: 0.0 it will generate this:
<input type="number decimal" name="depreciationRate" value="" min="0.0" id="depreciationRate" />
with a min="0.0" attempting to enforce the minimum. Which doesn't work because the browser falls back to "text" for the invalid "number decimal", and therefore min= is ignored by the browser.
This is all very broken, not a minor bug here!
3.0.0.RC1
The text was updated successfully, but these errors were encountered:
The problem is in FormFieldsTagLib.groovy renderNumericInput() which added localized number formatting. I guess It should not apply formatting when rendering an edit field somehow.
A quick fix is to disable localized numbering using config grails.plugin.fields.localizeNumbers = false
If I have a field in my domain class:
Long myField
and that field has a value of 1000000. It ends up generating this HTML:
<input type="number" name="weighting" value="1,000,000" required="" id="myField" />
Those commas mean that the value is never seen because html numeric fields don't like commas.
Tracing the code, this comes from FormFieldsTagLib.groovy line 729:
attrs.value = numberFormatter.format(propertyAccessor.value)
As far as I can see, there should never be locale specific formatting for input fields. Display fields... maybe. But not input fields.
Furthermore, if the type of the field is float or big decimal, the input field looks like this:
<input type="number decimal" name="depreciationRate" value="" id="depreciationRate" />
as far as I know "number decimal" is completely invalid html. Furthermore, if you put a constraint on the field of say min: 0.0 it will generate this:
<input type="number decimal" name="depreciationRate" value="" min="0.0" id="depreciationRate" />
with a min="0.0" attempting to enforce the minimum. Which doesn't work because the browser falls back to "text" for the invalid "number decimal", and therefore min= is ignored by the browser.
This is all very broken, not a minor bug here!
3.0.0.RC1
The text was updated successfully, but these errors were encountered: