-
Notifications
You must be signed in to change notification settings - Fork 26
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
Form submit fails on attributes with the type 'number' #66
Comments
Checked the log, which was going by too quickly to notice earlier. I get the error Uncaught Error: value not in set of provided options. I think this is because the number array is converted to strings when in the DOM. When the view reads these values later, it doesn't match the attribute, which is the number 2 instead of "2" as seen by the |
hey @dw2! it's actually doing a if you'd want to edit your node_modules/ampersand-select-view/ampersand-select-view.js and slap a debugger statement right around there, report back on thx! |
@cdaringe thanks for the reply. You are correct that it does a loose comparison with == for array options, but for textvalue option arrays, it uses indexOf to find the value. The PR I just made will apply a loose comparison in both cases, as well as allow for mixed option sets. |
I'm attempting to use a select box to pick from an array of numbers with labels (i.e. [[1,'Once'], [2,'Twice'], ...]. However, since the attribute is set to 'number' in the model, this causes the form to fail. (Edit: more info below)
The text was updated successfully, but these errors were encountered: