@descope/web-components-ui 1.0.201 → 1.0.202

Sign up to get free protection for your applications and to get access to all the features.
@@ -7578,7 +7578,7 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
7578
7578
  }
7579
7579
 
7580
7580
  onClick(e) {
7581
- if (!this.isReadonly && e.target !== e.currentTarget) {
7581
+ if (e.target !== e.currentTarget) {
7582
7582
  if (e.target === this.getSelectedNode() && this.allowDeselect) {
7583
7583
  this.removeSelected();
7584
7584
  } else {
@@ -7624,6 +7624,10 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
7624
7624
  });
7625
7625
  }
7626
7626
 
7627
+ onReadOnlyChange() {
7628
+ this.querySelector('slot').toggleAttribute('inert', this.isReadonly);
7629
+ }
7630
+
7627
7631
  getValidity() {
7628
7632
  if (this.isRequired && !this.value) {
7629
7633
  return { valueMissing: true };
@@ -7638,6 +7642,9 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
7638
7642
  case 'size':
7639
7643
  this.onSizeChange();
7640
7644
  break;
7645
+ case 'readonly':
7646
+ this.onReadOnlyChange();
7647
+ break;
7641
7648
  }
7642
7649
  });
7643
7650
  }
@@ -7647,14 +7654,16 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
7647
7654
  this.addEventListener('focus', (e) => {
7648
7655
  // we want to ignore focus events we are dispatching
7649
7656
  if (e.isTrusted) {
7650
- this.items[0].focus();
7657
+ this.items[0]?.focus();
7651
7658
  }
7652
7659
  });
7653
7660
 
7654
7661
  super.init?.();
7655
7662
  this.setDefaultValue();
7656
7663
 
7657
- observeAttributes(this, this.onObservedAttributeChange.bind(this), { includeAttrs: ['size'] });
7664
+ observeAttributes(this, this.onObservedAttributeChange.bind(this), {
7665
+ includeAttrs: ['size', 'readonly'],
7666
+ });
7658
7667
 
7659
7668
  this.querySelector('slot').addEventListener('click', this.onClick.bind(this));
7660
7669
  }