@descope/web-components-ui 1.0.403 → 1.0.404

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.
@@ -16981,11 +16981,29 @@ class RawHybridField extends BaseClass$1 {
16981
16981
  this.activeInput.value = val;
16982
16982
  }
16983
16983
 
16984
- init() {
16984
+ async init() {
16985
16985
  super.init?.();
16986
+
16986
16987
  this.initInputs();
16987
16988
  this.updateAttrs();
16988
16989
  this.toggleInputVisibility();
16990
+
16991
+ await this.waitForInputs();
16992
+
16993
+ this.initInputEles();
16994
+ this.overrideEmailInputType();
16995
+ this.overrideEmailSetAttribute();
16996
+ }
16997
+
16998
+ waitForInputs() {
16999
+ return new Promise((resolve) => {
17000
+ const check = setInterval(() => {
17001
+ if (this.emailInputEle) {
17002
+ clearInterval(check);
17003
+ resolve();
17004
+ }
17005
+ });
17006
+ });
16989
17007
  }
16990
17008
 
16991
17009
  initInputs() {
@@ -16996,19 +17014,6 @@ class RawHybridField extends BaseClass$1 {
16996
17014
  this.inputs = [this.emailInput, this.phoneCountryCodeInput, this.phoneInputBoxInput];
16997
17015
 
16998
17016
  this.activeInput = this.emailInput;
16999
-
17000
- this.initInputEles();
17001
- this.overrideEmailInputType();
17002
-
17003
- // We want to prevent Vaadin from changing the input type to `email`
17004
- // otherwise, we cannot get the selectionStart from the input.
17005
- const origEmailSetAttr = this.emailInput.setAttribute.bind(this.emailInputEle);
17006
- this.emailInputEle.setAttribute = (name, value) => {
17007
- if (name !== 'type' || value !== 'email' || !this.emailInput.hasAttribute('focused')) {
17008
- return origEmailSetAttr(name, value);
17009
- }
17010
- return false;
17011
- };
17012
17017
  }
17013
17018
 
17014
17019
  // we need to listen on the inner `input` element itself, otherwise we don't always get an `input` event
@@ -17020,7 +17025,7 @@ class RawHybridField extends BaseClass$1 {
17020
17025
  ];
17021
17026
 
17022
17027
  inputEles.forEach((ele) => {
17023
- ele?.addEventListener('input', this.onValueChange.bind(this));
17028
+ ele.addEventListener('input', this.onValueChange.bind(this));
17024
17029
  });
17025
17030
  }
17026
17031
 
@@ -17030,11 +17035,23 @@ class RawHybridField extends BaseClass$1 {
17030
17035
  });
17031
17036
  this.emailInputEle.addEventListener('blur', () => {
17032
17037
  setTimeout(() => {
17033
- this.emailInputEle?.setAttribute('type', 'email');
17038
+ this.emailInputEle.setAttribute('type', 'email');
17034
17039
  });
17035
17040
  });
17036
17041
  }
17037
17042
 
17043
+ // We want to prevent Vaadin from changing the input type to `email`
17044
+ // otherwise, we cannot get the selectionStart from the input.
17045
+ overrideEmailSetAttribute() {
17046
+ const origEmailSetAttr = this.emailInput.setAttribute.bind(this.emailInputEle);
17047
+ this.emailInputEle.setAttribute = (name, value) => {
17048
+ if (name !== 'type' || value !== 'email' || !this.emailInput.hasAttribute('focused')) {
17049
+ return origEmailSetAttr(name, value);
17050
+ }
17051
+ return false;
17052
+ };
17053
+ }
17054
+
17038
17055
  updateAttrs() {
17039
17056
  this.inputs.forEach((input) => forwardAttrs(this, input, { includeAttrs: attrs.shared }));
17040
17057