From f08a252b510a81faf75682d38ec8dcd48457ece0 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sat, 21 Mar 2020 22:09:49 +0800 Subject: [PATCH] =?UTF-8?q?select2=20=E5=A4=9A=E9=80=89=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E4=B8=8D=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E7=A6=81=E7=94=A8=20First=20Item=20=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/select2/4.0/select2.js | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/common/src/main/resources/static/select2/4.0/select2.js b/common/src/main/resources/static/select2/4.0/select2.js index 78adda51..346a6fe3 100644 --- a/common/src/main/resources/static/select2/4.0/select2.js +++ b/common/src/main/resources/static/select2/4.0/select2.js @@ -857,22 +857,23 @@ S2.define('select2/results',[ }; Results.prototype.highlightFirstItem = function () { - var $options = this.$results - .find('.select2-results__option[aria-selected]'); - - var $selected = $options.filter('[aria-selected=true]'); - - // Check if there are any selected options - if ($selected.length > 0) { - // If there are selected options, highlight the first - $selected.first().trigger('mouseenter'); - } else { - // If there are no selected options, highlight the first option - // in the dropdown - $options.first().trigger('mouseenter'); - } - - this.ensureHighlightVisible(); +// var $options = this.$results +// .find('.select2-results__option[aria-selected]'); +// +// var $selected = $options.filter('[aria-selected=true]'); +// +// // Check if there are any selected options +// if ($selected.length > 0) { +// // If there are selected options, highlight the first +// $selected.first().trigger('mouseenter'); +// } else { +// // If there are no selected options, highlight the first option +// // in the dropdown +// $options.first().trigger('mouseenter'); +// } +// +// this.ensureHighlightVisible(); +// ThinkGem 禁用 First Item 高亮 }; Results.prototype.setClasses = function () {