slim-select 3.1.2 → 3.1.4

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.
@@ -309,7 +309,7 @@ class N {
309
309
  // Classes
310
310
  classes;
311
311
  constructor(e, t, s, i) {
312
- this.store = s, this.settings = e, this.classes = t, this.callbacks = i, this.lastSelectedOption = null, this.main = this.mainDiv(), this.content = this.contentDiv(), this.updateClassStyles(), this.updateAriaAttributes(), this.settings.contentLocation && this.settings.contentLocation.appendChild(this.content.main);
312
+ this.store = s, this.settings = e, this.classes = t, this.callbacks = i, this.lastSelectedOption = null, this.main = this.mainDiv(), this.content = this.contentDiv(), this.updateClassStyles(), this.updateAriaAttributes(), this.settings.contentPosition !== "relative" && (this.content.main.style.top = "-9999px", this.content.main.style.left = "-9999px", this.content.main.style.margin = "0", this.content.main.style.width = "auto"), this.settings.contentLocation && this.settings.contentLocation.appendChild(this.content.main);
313
313
  }
314
314
  // Remove disabled classes
315
315
  enable() {
@@ -1070,9 +1070,7 @@ class M {
1070
1070
  if (l.__slimSelectLabelHandler)
1071
1071
  return;
1072
1072
  const a = (n) => {
1073
- n.preventDefault(), n.stopPropagation(), this.onLabelClick && setTimeout(() => {
1074
- this.onLabelClick();
1075
- }, 0);
1073
+ n.target === l && (n.preventDefault(), this.onLabelClick && this.onLabelClick());
1076
1074
  };
1077
1075
  l.__slimSelectLabelHandler = a, l.addEventListener("click", a, { capture: !0, passive: !1 });
1078
1076
  });
@@ -1184,7 +1182,7 @@ class I {
1184
1182
  }, this.select.onOptionsChange = (n) => {
1185
1183
  this.setData(n || []);
1186
1184
  }, this.select.onLabelClick = () => {
1187
- this.settings.disabled || this.open();
1185
+ this.settings.disabled || (this.settings.isOpen ? this.close() : this.open());
1188
1186
  };
1189
1187
  const s = e.data ? e.data : this.select.getData();
1190
1188
  this.store = new k(this.settings.isMultiple ? "multiple" : "single", s), e.data && this.select.updateOptions(this.store.getData());