-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReactLink doesn't work for input type="range" #437
Comments
Could you make a fiddle using http://jsfiddle.net/spicyj/BrU6B/ as a starting point? Thanks. |
Looks like SelectEventPlugin's getSelection accesses .selectionStart on the range input which throws an exception because it isn't a text input (as specified in the DOM spec: http://www.w3.org/TR/2009/WD-html5-20090423/editing.html#textFieldSelection). (cc @joshduck) |
In fact, this looks like it happens even if you make a custom onChange handler. Meaning it's very hard to use range selectors in React. :( |
Accessing .selectionStart on a non-text input will throw (see http://www.w3.org/TR/2009/WD-html5-20090423/editing.html#textFieldSelection), so check that the input has selection capabilities before accessing the property. Fixes facebook#437.
I updated the JSFiddle links when we upgraded to 0.5.0, aren't they working / where did you get your fiddle link? |
http://jsfiddle.net/vjeux/25Rhk/ and http://jsfiddle.net/zpao/uaKdV/ are both older versions. |
@phou87 Thanks a lot for reporting! We'll roll this into the next release. |
No problem, thanks for the quick turnaround! When is the next release? |
Accessing .selectionStart on a non-text input will throw (see http://www.w3.org/TR/2009/WD-html5-20090423/editing.html#textFieldSelection), so check that the input has selection capabilities before accessing the property. Fixes #437.
Can't provide a fiddle since it doesn't support 0.5.0 yet, but I get this error:
Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.
Works fine with other types of inputs.
The text was updated successfully, but these errors were encountered: