Comments (11)
It might be a Chrome and/or Safari issue to not accept float elements in input type "number", but we'd have to take a look at the html5 specification to see how they should handle that. If you don't want "number" to be rendered, you can update it by passing the following option to your input:
:input_html => { :type => 'text' }
This would render an input type text instead of number.
from simple_form.
I had a problem with type="number" field too, but the field here is an integer, not float.
in chrome it shows up like that: http://cl.ly/6906ea16a2166174fc6f (in a form creating a new record)
using
:input_html => { :type => 'text' }
it works fine
from simple_form.
@rafaelss set it value to 0 if field value is not passed or isn't an integer
from simple_form.
@Baael I think would be good if simple_form could handle this, there will cases where it might have lots of integer fields and set 0 for all of them looks a bit "ugly" for me :)
from simple_form.
Guys, it seems more to be a Chrome/Safari issue, handling these inputs type=number wrong. I don't think that setting a default value to these attributes is a valid case for SimpleForm, as we shouldn't touch the given value. It's more likely to be a case to add default values for models or pass them straight to inputs. Might we have another way to solve it?
from simple_form.
Closing as won't fix, if you think this is still an issue with SimpleForm, please reopen.
from simple_form.
this should be re-opened...
http://dev.w3.org/html5/spec-author-view/common-input-element-attributes.html#attr-input-step
if you are going to specify the input as a number, you must specify the "step" attribute, or else the default of 1 will be used (i.e. integer) Right now only a few browsers implement this right, but some do, so we need to have type=number, step=any for our floats.
note that the step=any gives us free reign to specify it to thousandths, millionths, or whatever...
from simple_form.
SimpleForm in master branch already sets the default step attribute to "any" for non-integer columns, as you can see in 5aa4320. Expect a new release soon.
from simple_form.
http://dev.w3.org/html5/spec-author-view/number-state.html#number-state
has more relevant information....
from simple_form.
ah, ok. my fault for not checking master. I'm pulling from git for now, thanks :)
from simple_form.
No problem. Let us know if it works fine for you =).
On Tue, May 3, 2011 at 4:35 PM, fringd <
[email protected]>wrote:
ah, ok. my fault for not checking master. I'm pulling from git for now,
thanks :)Reply to this email directly or view it on GitHub:
#41 (comment)
At.
Carlos A. da Silva
from simple_form.
Related Issues (20)
- 5.2.0 applies `vertical_select` wrapper despite `wrapper: :horizontal_form` HOT 1
- Changelog entry needed for 5.2.0 HOT 3
- Is there any particular reason for the use of `%%` instead of `%` in the ERB template? HOT 2
- @builder.input_field(:license_plate, type: 'radio' .... ) output a textarea tag instead of an inpt HOT 1
- Broken Link in Readme File for Bootstrap Live App example HOT 4
- Chrome error: label's for attribute doesn't match any element id
- Bootstrap floating labels keep floating even without input HOT 1
- Auto reload configuration HOT 3
- `config.default_form_class` should not be *overriden* but *complemented* when `html: { :class }` is specified HOT 1
- Redundant aria-required on required fields HOT 1
- 5.3.0 - Custom Inputs Fail to Load HOT 3
- Rails 7.1 updated password validation changed rendering of password inputs
- Custom Component raise an error with rails 7.1 and zeitwerk HOT 1
- Hints don't work on the namespaced model HOT 1
- Encrypted attributes always default to textarea
- Proposal for customizable classes merging
- The custom `error:` on all inputs does not work if there is an object present
- Multiple inputs with the same name generate unparseable names in Rails >= 7.1.1
- <div class="checkbox"> <input value="false" type="hidden" name="meal[completed]"> <input class="boolean optional" type="checkbox" value="true" checked="checked" name="meal[completed]" id="meal_completed"> <label class="boolean optional" for="meal_completed">Completed</label> </div>Update: This bug only appears if you have custom value for `unchecked_value`. In this case `unchecked_value: false` HOT 1
- https://simple-form-bootstrap.herokuapp.com/ is Down HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple_form.