@descope/web-components-ui 1.0.212 → 1.0.213

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/dist/index.esm.js CHANGED
@@ -966,6 +966,9 @@ const proxyInputMixin =
966
966
  // We do not want to show the default validity report tooltip
967
967
  // So we are overriding the reportValidity fn to show the input's error message
968
968
  reportValidity = () => {
969
+ // we want to update validity so in case the value was set programmatically, we won't get an error
970
+ this.inputElement.setCustomValidity('');
971
+ this.setCustomValidity('');
969
972
  if (!this.checkValidity()) {
970
973
  this.setAttribute('invalid', 'true');
971
974
  this.#handleErrorMessage();
@@ -4790,7 +4793,7 @@ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$3 {
4790
4793
 
4791
4794
  // override combo box setter to display dialCode value in input
4792
4795
  this.countryCodeInput.customValueTransformFn = (val) => {
4793
- const [, dialCode] = val.split(' ');
4796
+ const [, dialCode] = val?.split?.(' ') || [];
4794
4797
  return dialCode;
4795
4798
  };
4796
4799
  }
@@ -4862,9 +4865,7 @@ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$3 {
4862
4865
  }
4863
4866
 
4864
4867
  getCountryByDialCode(countryDialCode) {
4865
- return this.countryCodeInput.items?.find(
4866
- (c) => c.getAttribute('data-country-code') === countryDialCode
4867
- );
4868
+ return this.countryCodeInput.items?.find((c) => c.getAttribute('data-id') === countryDialCode);
4868
4869
  }
4869
4870
 
4870
4871
  getCountryByCodeId(countryCode) {