From 826c1467bf7435e2d84304c2109d1461f6df65ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=9A=A9=EC=A4=80?= Date: Fri, 14 Jun 2024 17:57:22 +0900 Subject: [PATCH] select multiple active item by shift/ctrl + mousedown --- src/selectize.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/selectize.js b/src/selectize.js index 054553f2a..30a352a2c 100644 --- a/src/selectize.js +++ b/src/selectize.js @@ -446,7 +446,7 @@ $.extend(Selectize.prototype, { // toggle dropdown self.isOpen ? self.close() : self.open(); } else { - if (!defaultPrevented) { + if (!defaultPrevented && !self.isShiftDown && !self.isCmdDown) { self.setActiveItem(null); } if (!self.settings.openOnFocus) { @@ -924,7 +924,7 @@ $.extend(Selectize.prototype, { // modify selection eventName = e && e.type.toLowerCase(); - if (eventName === 'mousedown' && self.isShiftDown && self.$activeItems.length) { + if (eventName === 'mouseup' && self.isShiftDown && self.$activeItems.length) { $last = self.$control.children('.active:last'); begin = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$last[0]]); end = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$item[0]]); @@ -941,7 +941,7 @@ $.extend(Selectize.prototype, { } } e.preventDefault(); - } else if ((eventName === 'mousedown' && self.isCtrlDown) || (eventName === 'keydown' && this.isShiftDown)) { + } else if (eventName === 'mouseup' && self.isCtrlDown) { if ($item.hasClass('active')) { idx = self.$activeItems.indexOf($item[0]); self.$activeItems.splice(idx, 1);