@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.umd.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
|
(function (global, factory) {
|
|
@@ -11370,6 +11370,13 @@
|
|
|
11370
11370
|
} }));
|
|
11371
11371
|
|
|
11372
11372
|
|
|
11373
|
+
p.sink.add(dropList.el, 'mousedown', function (event) {
|
|
11374
|
+
var li = Dom.closestUntil(event.target, 'li', event.currentTarget);
|
|
11375
|
+
if (!li) return;
|
|
11376
|
+
|
|
11377
|
+
event.preventDefault();
|
|
11378
|
+
});
|
|
11379
|
+
|
|
11373
11380
|
this._registerDropdownEvents();
|
|
11374
11381
|
} }, { key: "_unregisterDropdownEvents", value:
|
|
11375
11382
|
|
|
@@ -11398,6 +11405,9 @@
|
|
|
11398
11405
|
return;
|
|
11399
11406
|
|
|
11400
11407
|
var suppressEnterSpaceToggle = false;
|
|
11408
|
+
var lastKeyAllowsNonTypeKeys = p.lastKeyAllowsNonTypeKeys;
|
|
11409
|
+
p.lastKeyAllowsNonTypeKeys = false;
|
|
11410
|
+
var hasInputText = p.input && p.input.value.length > 0;
|
|
11401
11411
|
|
|
11402
11412
|
switch (evt.key) {
|
|
11403
11413
|
case keycodeJs.VALUE_PAGE_UP:
|
|
@@ -11407,12 +11417,13 @@
|
|
|
11407
11417
|
case keycodeJs.VALUE_HOME:
|
|
11408
11418
|
case keycodeJs.VALUE_END:
|
|
11409
11419
|
if ((evt.key === keycodeJs.VALUE_HOME || evt.key === keycodeJs.VALUE_END) &&
|
|
11410
|
-
|
|
11420
|
+
hasInputText && !lastKeyAllowsNonTypeKeys) {
|
|
11411
11421
|
// Allow using HOME/END button within the textbox
|
|
11412
11422
|
dropList._keydownFreeType(evt);
|
|
11413
11423
|
break;
|
|
11414
11424
|
}
|
|
11415
11425
|
|
|
11426
|
+
p.lastKeyAllowsNonTypeKeys = true;
|
|
11416
11427
|
evt.preventDefault();
|
|
11417
11428
|
|
|
11418
11429
|
switch (evt.key) {
|
|
@@ -11450,7 +11461,9 @@
|
|
|
11450
11461
|
break;
|
|
11451
11462
|
|
|
11452
11463
|
case keycodeJs.VALUE_SPACE:
|
|
11453
|
-
if (
|
|
11464
|
+
if (lastKeyAllowsNonTypeKeys) {
|
|
11465
|
+
p.lastKeyAllowsNonTypeKeys = true;
|
|
11466
|
+
|
|
11454
11467
|
if (dropList.isVisible() && dropList.hasFocusedItem()) {
|
|
11455
11468
|
suppressEnterSpaceToggle = true;
|
|
11456
11469
|
if (p.multi)
|
|
@@ -11488,14 +11501,6 @@
|
|
|
11488
11501
|
break;}
|
|
11489
11502
|
|
|
11490
11503
|
|
|
11491
|
-
p.lastKeyAllowsNonTypeKeys = evt.key === keycodeJs.VALUE_UP ||
|
|
11492
|
-
evt.key === keycodeJs.VALUE_DOWN ||
|
|
11493
|
-
evt.key === keycodeJs.VALUE_PAGE_UP ||
|
|
11494
|
-
evt.key === keycodeJs.VALUE_PAGE_DOWN ||
|
|
11495
|
-
evt.key === keycodeJs.VALUE_HOME ||
|
|
11496
|
-
evt.key === keycodeJs.VALUE_END ||
|
|
11497
|
-
evt.key === keycodeJs.VALUE_SPACE && !!p.lastKeyAllowsNonTypeKeys;
|
|
11498
|
-
|
|
11499
11504
|
if (!suppressEnterSpaceToggle) {
|
|
11500
11505
|
if (evt.key === keycodeJs.VALUE_ENTER ||
|
|
11501
11506
|
evt.key === keycodeJs.VALUE_SPACE &&
|