Browse Source

Fixes #2436 - onChange should use string equality since input will be stored as string

flex-list
jlukic 9 years ago
parent
commit
1a3d46fc8c
2 changed files with 5 additions and 1 deletions
  1. 1
      RELEASE-NOTES.md
  2. 5
      src/definitions/modules/dropdown.js

1
RELEASE-NOTES.md

@ -185,6 +185,7 @@
- **Dropdown** - Fixed issue with matching boolean values, and using `set selected` with `true` or `false`
- **Dropdown** - Fixed `search dropdown` submitting parent form when enter shortcut pressed
- **Dropdown** - Fixed dropdown menu items should not center inside of a center aligned container.
- **Dropdown** - Fixed some cases where onChange would not occur for values matching equality against '', for example `0`
- **Form** - Form will no longer set a height for `textarea` using the `rows` property
- **Form** - `inline fields` are now `1em` and do not match label's reduced size
- **Form** - `field` inside `fields` no longer produce double sized margins.

5
src/definitions/modules/dropdown.js

@ -2040,10 +2040,13 @@ $.fn.dropdown = function(parameters) {
hasInput = ($input.length > 0),
isAddition = !module.has.value(value),
currentValue = module.get.values(),
stringValue = (typeof value == 'number')
? value.toString()
: value,
newValue
;
if(hasInput) {
if(value == currentValue) {
if(stringValue == currentValue) {
module.verbose('Skipping value update already same value', value, currentValue);
if(!module.is.initialLoad()) {
return;

Loading…
Cancel
Save