Browse Source

Add #2260 to next

pull/2300/head
jlukic 10 years ago
parent
commit
e179975995
2 changed files with 8 additions and 7 deletions
  1. 1
      RELEASE-NOTES.md
  2. 14
      src/definitions/modules/dropdown.js

1
RELEASE-NOTES.md

@ -112,6 +112,7 @@
- **Checkbox** - Fixes nested `dropdown` inside `checkbox` causing issues - **Checkbox** - Fixes nested `dropdown` inside `checkbox` causing issues
- **Divider** - Hidden divider now correctly hides vertical dividers - **Divider** - Hidden divider now correctly hides vertical dividers
- **Divider** - Fixes single icon alignment inside `vertical divider` or `horizontal divider` - **Divider** - Fixes single icon alignment inside `vertical divider` or `horizontal divider`
- **Dropdown** - `focus` after changing tabs will no longer cause menu to re-open **Thanks @trevorharwell**
- **Dropdown** - Fixes issue with headers disappearing inside of `ui dropdown` when nested in `ui menu` - **Dropdown** - Fixes issue with headers disappearing inside of `ui dropdown` when nested in `ui menu`
- **Dropdown** - Fixes `onChange` to fire when input value changes, not just when menu UI changes - **Dropdown** - Fixes `onChange` to fire when input value changes, not just when menu UI changes
- **Dropdown** - Dropdowns with `transition: none` now work correctly. - **Dropdown** - Dropdowns with `transition: none` now work correctly.

14
src/definitions/modules/dropdown.js

@ -67,6 +67,7 @@ $.fn.dropdown = function(parameters) {
element = this, element = this,
instance = $module.data(moduleNamespace), instance = $module.data(moduleNamespace),
pageLostFocus,
elementNamespace, elementNamespace,
id, id,
selectObserver, selectObserver,
@ -734,7 +735,7 @@ $.fn.dropdown = function(parameters) {
event: { event: {
focus: function() { focus: function() {
if(settings.showOnFocus && !activated && module.is.hidden()) {
if(settings.showOnFocus && !activated && module.is.hidden() && !pageLostFocus) {
module.show(); module.show();
} }
}, },
@ -748,9 +749,7 @@ $.fn.dropdown = function(parameters) {
} }
}, },
blur: function(event) { blur: function(event) {
var
pageLostFocus = (document.activeElement === this)
;
pageLostFocus = (document.activeElement === this);
if(!activated && !pageLostFocus) { if(!activated && !pageLostFocus) {
module.remove.activeLabel(); module.remove.activeLabel();
module.hide(); module.hide();
@ -774,9 +773,7 @@ $.fn.dropdown = function(parameters) {
} }
}, },
blur: function(event) { blur: function(event) {
var
pageLostFocus = (document.activeElement === this)
;
pageLostFocus = (document.activeElement === this);
if(!itemActivated && !pageLostFocus) { if(!itemActivated && !pageLostFocus) {
if(module.is.multiple()) { if(module.is.multiple()) {
module.remove.activeLabel(); module.remove.activeLabel();
@ -1214,6 +1211,9 @@ $.fn.dropdown = function(parameters) {
}, },
determine: { determine: {
pageLostFocus: function() {
pageLostFocus = (document.activeElement === this);
},
selectAction: function(text, value) { selectAction: function(text, value) {
module.verbose('Determining action', settings.action); module.verbose('Determining action', settings.action);
if( $.isFunction( module.action[settings.action] ) ) { if( $.isFunction( module.action[settings.action] ) ) {

Loading…
Cancel
Save