Browse Source

Fix some conditions which caused dropdown to hide all results

pull/3130/merge
Jack 9 years ago
parent
commit
a2347d68b7
2 changed files with 14 additions and 7 deletions
  1. 2
      RELEASE-NOTES.md
  2. 19
      src/definitions/modules/dropdown.js

2
RELEASE-NOTES.md

@ -21,6 +21,8 @@
**Bugs** **Bugs**
- **Divider/Step/Modal/AD** - Fixes 1px jump at `@mobileBreakpoint` caused by incorrect edge conditions in media query #3180 **THanks @mdehoog** - **Divider/Step/Modal/AD** - Fixes 1px jump at `@mobileBreakpoint` caused by incorrect edge conditions in media query #3180 **THanks @mdehoog**
- **Dimmer** - Dimmer can now works correctly with `opacity: 0` #3167 **Thanks @mdehoog** - **Dimmer** - Dimmer can now works correctly with `opacity: 0` #3167 **Thanks @mdehoog**
- **Dropdown** - Fixed condition where focusing on dropdown would show a blank menu when "no results" was reached and the dropdown was refocused
- **Dropdown** - Search dropdowns will now correctly filter by current search term on re-focus
- **Dropdown** - Fixed issue where tabindex was being removed incorrectly with `selection dropdown` in some cases. #3002 - **Dropdown** - Fixed issue where tabindex was being removed incorrectly with `selection dropdown` in some cases. #3002
- **Dropdown** - Added `remoteValues` as a possible `field` setting. Allowing users to return API results using arbitrary JSON object groupings. #3080 - **Dropdown** - Added `remoteValues` as a possible `field` setting. Allowing users to return API results using arbitrary JSON object groupings. #3080
- **Dropdown** - Added ability to pass in `keys` as a setting, to avoid issues with languages where comma delimiter may be a different keycode #3016 - **Dropdown** - Added ability to pass in `keys` as a setting, to avoid issues with languages where comma delimiter may be a different keycode #3016

19
src/definitions/modules/dropdown.js

@ -413,7 +413,7 @@ $.fn.dropdown = function(parameters) {
if(module.is.multiple() && !module.has.search() && module.is.allFiltered()) { if(module.is.multiple() && !module.has.search() && module.is.allFiltered()) {
return true; return true;
} }
if(module.has.message() && !module.has.maxSelections()) {
if(module.has.message() && !(module.has.maxSelections() || module.has.allResultsFiltered()) ) {
module.remove.message(); module.remove.message();
} }
if(settings.onShow.call(element) !== false) { if(settings.onShow.call(element) !== false) {
@ -791,13 +791,17 @@ $.fn.dropdown = function(parameters) {
: $activeItem, : $activeItem,
hasSelected = ($selectedItem.size() > 0) hasSelected = ($selectedItem.size() > 0)
; ;
if( hasSelected && module.has.query() ) {
module.debug('Forcing partial selection to selected item', $selectedItem);
module.event.item.click.call($selectedItem);
}
else {
module.hide();
if( module.has.query() ) {
if(hasSelected) {
module.debug('Forcing partial selection to selected item', $selectedItem);
module.event.item.click.call($selectedItem);
return;
}
else {
module.remove.searchTerm();
}
} }
module.hide();
}, },
event: { event: {
@ -842,6 +846,7 @@ $.fn.dropdown = function(parameters) {
module.remove.activeLabel(); module.remove.activeLabel();
} }
if(settings.showOnFocus) { if(settings.showOnFocus) {
module.search();
module.show(); module.show();
} }
}, },

Loading…
Cancel
Save