@danielgindi/selectbox 1.0.115 → 1.0.116

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.115
2
+ * @danielgindi/selectbox 1.0.116
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -4341,7 +4341,8 @@ class SelectBox {
4341
4341
  evt.key === keycodeJs.VALUE_SPACE &&
4342
4342
  p.lastKeyAllowsNonTypeKeys &&
4343
4343
  !p.multi &&
4344
- !dropList.hasFocusedItem())
4344
+ !dropList.hasFocusedItem() &&
4345
+ !p.disabled)
4345
4346
  {
4346
4347
  this.toggleList();
4347
4348
  evt.preventDefault();
@@ -4353,6 +4354,8 @@ class SelectBox {
4353
4354
  if (p.input) {
4354
4355
  p.sink.
4355
4356
  add(p.input, 'input.dropdown', () => {
4357
+ if (p.disabled) return;
4358
+
4356
4359
  p.filterTerm = p.input.value.trim();
4357
4360
  p.filteredItems = null;
4358
4361
  p.itemsChanged = true;
@@ -4362,11 +4365,15 @@ class SelectBox {
4362
4365
  p.throttledUpdateListItems();
4363
4366
  }).
4364
4367
  add(p.input, 'click.dropdown', () => {
4368
+ if (p.disabled) return;
4369
+
4365
4370
  if (!p.multi && p.searchable) {
4366
4371
  this.openList();
4367
4372
  }
4368
4373
  }).
4369
4374
  add(p.input, 'focus.dropdown', () => {
4375
+ if (p.disabled) return;
4376
+
4370
4377
  this._trigger('search:focus');
4371
4378
 
4372
4379
  if (this[DestroyedSymbol]) return; // destroyed by event handler
@@ -4378,6 +4385,8 @@ class SelectBox {
4378
4385
  setTimeout(() => {avoidToggleFromClick = false;}, 10);
4379
4386
  }).
4380
4387
  add(p.input, 'blur.dropdown', () => {
4388
+ if (p.disabled) return;
4389
+
4381
4390
  this._trigger('search:blur');
4382
4391
 
4383
4392
  if (this[DestroyedSymbol]) return; // destroyed by event handler
@@ -4391,7 +4400,7 @@ class SelectBox {
4391
4400
 
4392
4401
  p.sink.
4393
4402
  add(p.el, 'mousedown.dropdown', () => {
4394
- if (!p.multi && !p.searchable && !avoidToggleFromClick) {
4403
+ if (!p.multi && !p.searchable && !avoidToggleFromClick && !p.disabled) {
4395
4404
  this.toggleList();
4396
4405
  }
4397
4406
  avoidToggleFromClick = false;