From 24d2b34f53a9d600f0f77f9a54eaa4eddb10019f Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 31 Jul 2016 11:32:30 -0400 Subject: [PATCH] Fixes #4183 Fixes not working correctly since due to incorrect use of new function signature. --- RELEASE-NOTES.md | 1 + src/definitions/modules/dropdown.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 4c24b127c..a2580999e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -4,6 +4,7 @@ **Bugs** - **Dropdown** - `dropdown icon` no longer relies on stopping event propagation. This means using the dropdown icon will now cause other dropdowns to correctly hide. #3998 +- **Dropdown** - Fixes `action: select` not working correctly since `2.2` due to incorrect use of new function signature. ### Version 2.2.2 - July 07, 2016 diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 0daadcb0f..448a12409 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1554,8 +1554,19 @@ $.fn.dropdown = function(parameters) { }, select: function(text, value, element) { - // mimics action.activate but does not select text - module.action.activate.call(element); + value = (value !== undefined) + ? value + : text + ; + if( module.can.activate( $(element) ) ) { + module.set.value(value, $(element)); + if(module.is.multiple() && !module.is.allFiltered()) { + return; + } + else { + module.hideAndClear(); + } + } }, combo: function(text, value, element) {