Browse Source

#3108 Adds native change to dropdown

pull/3130/merge
Jack 9 years ago
parent
commit
528a510d6c
2 changed files with 16 additions and 2 deletions
  1. 5
      RELEASE-NOTES.md
  2. 13
      src/definitions/modules/dropdown.js

5
RELEASE-NOTES.md

@ -2,13 +2,16 @@
### Version 2.1.5 - Nov 1, 2015
**Minor Enhancements*8
**Minor Enhancements**
- **Form** - Adds `equal width form` and `equal width fields` for simpler grouped fields
- **Modal** - `onHide` callback can now cancel event by returning false #3168 **Thanks @mdehoog**
- **Dropdown** - Added `onLabelRemove` callback that allows value removal to be cancelled by callback **Thanks @goloveychuk**
- **Table** - Added `selectable` on table cell, allowing for full table-cell links
- **Popup** Added three new variables for `arrow` background color based on position, top, center or bottom. This makes it easier to use gradient backgrounds with popups and still match arrow colors.
**Major Bug Fixes**
- **Checkbox/Dropdown/Search** - Fixed issue where using `.trigger('change')` would not fire native `change` event. Only triggering event handlers attached with jQuery #3108
**Bugs**
- **Divider/Step/Modal/AD** - Fixes 1px jump at `@mobileBreakpoint` caused by incorrect edge conditions in media query #3180 **THanks @mdehoog**
- **Sticky** - Fixes bug where sticky would stick at incorrect times when using a different scroll container than `body` and when the container's `scrollTop` is not 0 on init.

13
src/definitions/modules/dropdown.js

@ -1299,6 +1299,17 @@ $.fn.dropdown = function(parameters) {
}
},
trigger: {
change: function() {
var
changeEvent = document.createEvent('HTMLEvents')
;
module.verbose('Triggering native change event');
changeEvent.initEvent('change', false, true);
element.dispatchEvent(changeEvent);
}
},
determine: {
selectAction: function(text, value) {
module.verbose('Determining action', settings.action);
@ -2185,7 +2196,7 @@ $.fn.dropdown = function(parameters) {
module.debug('Input native change event ignored on initial load');
}
else {
$input.trigger('change');
module.trigger.change();
}
internalChange = false;
}

Loading…
Cancel
Save