Skip to content

Commit

Permalink
#3108 Adds native change to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Nov 1, 2015
1 parent e3bc0c5 commit 528a510
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 528a510

Please sign in to comment.