From 73afa8ba7f17f2dda88d7b48ecfca8c9978bde8d Mon Sep 17 00:00:00 2001 From: Andrew Golubev Date: Mon, 24 Jul 2017 05:04:44 +0300 Subject: [PATCH] Prevent the event from firing twice for `.multiple` dropdowns on touch devices. Revert the last commit, because it was a mistake. --- src/definitions/modules/dropdown.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 6ab605506..5cf17d595 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1219,8 +1219,8 @@ $.fn.dropdown = function(parameters) { }); module.animate.show(false, $subMenu); } + event.preventDefault(); } - event.preventDefault(); } }, @@ -1609,6 +1609,7 @@ $.fn.dropdown = function(parameters) { if( module.can.activate( $(element) ) ) { module.set.selected(value, $(element)); if(module.is.multiple() && !module.is.allFiltered()) { + event.preventDefault(); return; } else { @@ -1625,6 +1626,7 @@ $.fn.dropdown = function(parameters) { if( module.can.activate( $(element) ) ) { module.set.value(value, $(element)); if(module.is.multiple() && !module.is.allFiltered()) { + event.preventDefault(); return; } else { @@ -1640,11 +1642,13 @@ $.fn.dropdown = function(parameters) { ; module.set.selected(value, $(element)); module.hideAndClear(); + event.preventDefault(); }, hide: function(text, value, element) { module.set.value(value, text); module.hideAndClear(); + event.preventDefault(); } },