@danielgindi/selectbox 2.0.30 → 2.0.32

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/lib/SelectBox.js CHANGED
@@ -306,7 +306,7 @@ class SelectBox {
306
306
  p.multiItemEls = [];
307
307
 
308
308
  this.enable(!p.disabled);
309
- this.setReadOnly(!p.readOnly);
309
+ this.setReadOnly(p.readOnly);
310
310
 
311
311
  this._setupDropdownMenu();
312
312
 
@@ -2874,10 +2874,10 @@ class SelectBox {
2874
2874
  toggleClass(p.el, `${p.baseClassName}__has_selection`, p.selectedValues.length > 0);
2875
2875
 
2876
2876
  if (p.searchable) {
2877
- if (p.input) p.input.readOnly = false;
2877
+ if (p.input) p.input.readOnly = p.readOnly;
2878
2878
  p.el.classList.add(`${p.baseClassName}__searchable`);
2879
2879
  } else {
2880
- if (p.input) p.input.readOnly = p.readOnly;
2880
+ if (p.input) p.input.readOnly = true;
2881
2881
  p.el.classList.remove(`${p.baseClassName}__searchable`);
2882
2882
  }
2883
2883
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
4
4
  "description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
5
5
  "main": "dist/lib.cjs.min.js",
6
6
  "module": "lib/index.js",
package/vue/SelectBox.vue CHANGED
@@ -43,10 +43,7 @@ export const PropTypes = {
43
43
  readOnly: {
44
44
  type: Boolean,
45
45
  required: false,
46
- },
47
- readonly: { // compatibility with simple readonly attr of inputs
48
- type: Boolean,
49
- required: false,
46
+ default: null,
50
47
  },
51
48
  clearable: {
52
49
  type: Boolean,
@@ -482,12 +479,7 @@ export default {
482
479
 
483
480
  readOnly() {
484
481
  if (this.nonReactive.instance)
485
- this.nonReactive.instance.setReadOnly(this.readOnly ?? this.readonly ?? false);
486
- },
487
-
488
- readonly() {
489
- if (this.nonReactive.instance)
490
- this.nonReactive.instance.setReadOnly(this.readOnly ?? this.readonly ?? false);
482
+ this.nonReactive.instance.setReadOnly(this.readOnly ?? false);
491
483
  },
492
484
 
493
485
  clearable(value) {
@@ -819,7 +811,7 @@ export default {
819
811
  baseClass: this.baseClass,
820
812
  direction: this.direction,
821
813
  disabled: this.disabled,
822
- readOnly: this.readOnly ?? this.readonly ?? false,
814
+ readOnly: this.readOnly ?? false,
823
815
  clearable: this.clearable,
824
816
  hasOpenIndicator: this.hasOpenIndicator,
825
817
  placeholder: this.placeholder,