@danielgindi/selectbox 1.0.80 → 1.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.cjs.js +16 -11
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +16 -11
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +16 -11
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/lib/SelectBox.js +15 -10
- package/package.json +1 -1
package/dist/lib.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 1.0.
|
|
2
|
+
* @danielgindi/selectbox 1.0.83
|
|
3
3
|
* git://github.com/danielgindi/selectbox.git
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -11374,6 +11374,13 @@ var SelectBox = /*#__PURE__*/function () {
|
|
|
11374
11374
|
} }));
|
|
11375
11375
|
|
|
11376
11376
|
|
|
11377
|
+
p.sink.add(dropList.el, 'mousedown', function (event) {
|
|
11378
|
+
var li = Dom.closestUntil(event.target, 'li', event.currentTarget);
|
|
11379
|
+
if (!li) return;
|
|
11380
|
+
|
|
11381
|
+
event.preventDefault();
|
|
11382
|
+
});
|
|
11383
|
+
|
|
11377
11384
|
this._registerDropdownEvents();
|
|
11378
11385
|
} }, { key: "_unregisterDropdownEvents", value:
|
|
11379
11386
|
|
|
@@ -11402,6 +11409,9 @@ var SelectBox = /*#__PURE__*/function () {
|
|
|
11402
11409
|
return;
|
|
11403
11410
|
|
|
11404
11411
|
var suppressEnterSpaceToggle = false;
|
|
11412
|
+
var lastKeyAllowsNonTypeKeys = p.lastKeyAllowsNonTypeKeys;
|
|
11413
|
+
p.lastKeyAllowsNonTypeKeys = false;
|
|
11414
|
+
var hasInputText = p.input && p.input.value.length > 0;
|
|
11405
11415
|
|
|
11406
11416
|
switch (evt.key) {
|
|
11407
11417
|
case keycodeJs.VALUE_PAGE_UP:
|
|
@@ -11411,12 +11421,13 @@ var SelectBox = /*#__PURE__*/function () {
|
|
|
11411
11421
|
case keycodeJs.VALUE_HOME:
|
|
11412
11422
|
case keycodeJs.VALUE_END:
|
|
11413
11423
|
if ((evt.key === keycodeJs.VALUE_HOME || evt.key === keycodeJs.VALUE_END) &&
|
|
11414
|
-
|
|
11424
|
+
hasInputText && !lastKeyAllowsNonTypeKeys) {
|
|
11415
11425
|
// Allow using HOME/END button within the textbox
|
|
11416
11426
|
dropList._keydownFreeType(evt);
|
|
11417
11427
|
break;
|
|
11418
11428
|
}
|
|
11419
11429
|
|
|
11430
|
+
p.lastKeyAllowsNonTypeKeys = true;
|
|
11420
11431
|
evt.preventDefault();
|
|
11421
11432
|
|
|
11422
11433
|
switch (evt.key) {
|
|
@@ -11454,7 +11465,9 @@ var SelectBox = /*#__PURE__*/function () {
|
|
|
11454
11465
|
break;
|
|
11455
11466
|
|
|
11456
11467
|
case keycodeJs.VALUE_SPACE:
|
|
11457
|
-
if (
|
|
11468
|
+
if (lastKeyAllowsNonTypeKeys) {
|
|
11469
|
+
p.lastKeyAllowsNonTypeKeys = true;
|
|
11470
|
+
|
|
11458
11471
|
if (dropList.isVisible() && dropList.hasFocusedItem()) {
|
|
11459
11472
|
suppressEnterSpaceToggle = true;
|
|
11460
11473
|
if (p.multi)
|
|
@@ -11492,14 +11505,6 @@ var SelectBox = /*#__PURE__*/function () {
|
|
|
11492
11505
|
break;}
|
|
11493
11506
|
|
|
11494
11507
|
|
|
11495
|
-
p.lastKeyAllowsNonTypeKeys = evt.key === keycodeJs.VALUE_UP ||
|
|
11496
|
-
evt.key === keycodeJs.VALUE_DOWN ||
|
|
11497
|
-
evt.key === keycodeJs.VALUE_PAGE_UP ||
|
|
11498
|
-
evt.key === keycodeJs.VALUE_PAGE_DOWN ||
|
|
11499
|
-
evt.key === keycodeJs.VALUE_HOME ||
|
|
11500
|
-
evt.key === keycodeJs.VALUE_END ||
|
|
11501
|
-
evt.key === keycodeJs.VALUE_SPACE && !!p.lastKeyAllowsNonTypeKeys;
|
|
11502
|
-
|
|
11503
11508
|
if (!suppressEnterSpaceToggle) {
|
|
11504
11509
|
if (evt.key === keycodeJs.VALUE_ENTER ||
|
|
11505
11510
|
evt.key === keycodeJs.VALUE_SPACE &&
|