Closed cdaringe closed 9 years ago
This looks good to me. + 1
https://github.com/cdaringe/ampersand-select-view/blob/3.0.0/ampersand-select-view.js#L190 is actually a bug that needs to be addressed. I have permitted short circuit to value ''
even if there is no ''
option available. Will resolve and address with tests soon.
closing for rework
This PR fixes https://github.com/AmpersandJS/ampersand-select-view/issues/5. The module and tests appeared to be designed intentionally to not fail when setting a bogus value. I.e., if the available options are
['a', 'b', 'c']
and you callsetValue('d')
, the select would just revert to the 0th index option or unselectedText. This behavior is dangerous. Issue 5 and self experience would indicate the there is a bug in the application code, thus, we now trigger errors when this situation occurs.This PR additionally:
unselectedText
option is selected couldundefined
possibly be appropriate. Would like feedback on this..value
on empty<select>
s is generally the empty string, DOM-wise.