@descope/web-components-ui 1.0.86 → 1.0.87

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -776,13 +776,24 @@ const proxyInputMixin = (superclass) =>
776
776
  this.#inputElement = super.inputElement;
777
777
  }
778
778
 
779
+ // the web-component does not loaded immediately, so we want to defer the warning
780
+ // and show it only if the input element was not found after the component is loaded
781
+ warnIfInputElementIsMissing() {
782
+ clearTimeout(this.inputElementTimerId);
783
+
784
+ this.inputElementTimerId = setTimeout(() => {
785
+ !this.#inputElement && console.warn('no input was found');
786
+ }, 0);
787
+ }
788
+
779
789
  get inputElement() {
780
- const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="input"]');
790
+ this.warnIfInputElementIsMissing();
791
+
792
+ const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="inputt"]');
781
793
  const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');
782
794
 
783
795
  this.#inputElement ??= getNestedInput(inputSlot) || getNestedInput(textAreaSlot);
784
796
 
785
- if (!this.#inputElement) throw Error('no input was found');
786
797
 
787
798
  return this.#inputElement
788
799
  }
@@ -792,7 +803,7 @@ const proxyInputMixin = (superclass) =>
792
803
  }
793
804
 
794
805
  getValidity() {
795
- return this.inputElement.validity
806
+ return this.inputElement?.validity || {}
796
807
  }
797
808
 
798
809
  handleInternalInputErrorMessage() {