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
Float field are rendered as text input and have no HTML5 validation on submit.
This permit to submit non numerical values for a float field.
I think the following definition are missing in lib/rails_admin/config/fields/types/float.rb
register_instance_option :view_helper do
:number_field
end
register_instance_option :html_attributes do
{
required: required?,
step: "any",
}
end
This will change the rendered field from: <input class="form-control" type="text" [...]>
to: <input class="form-control" step="any" type="number" [...]>
If this issue is confirmed I can make a PR for it.
Edit: added 'required' attribute
The text was updated successfully, but these errors were encountered:
Float field are rendered as text input and have no HTML5 validation on submit.
This permit to submit non numerical values for a float field.
I think the following definition are missing in lib/rails_admin/config/fields/types/float.rb
This will change the rendered field from:
<input class="form-control" type="text" [...]>
to:
<input class="form-control" step="any" type="number" [...]>
If this issue is confirmed I can make a PR for it.
Edit: added 'required' attribute
The text was updated successfully, but these errors were encountered: