diff --git a/pt-multilang-input.html b/pt-multilang-input.html index a74d580..a866006 100644 --- a/pt-multilang-input.html +++ b/pt-multilang-input.html @@ -167,7 +167,11 @@ set value(value){ let inputs = this.shadowRoot.querySelectorAll('#ironPages > *'); inputs.forEach((input) =>{ - input.value = value[input.dataLang] ? value[input.dataLang] : ""; + try { + input.value = value[input.dataLang]; + } catch (e) { + input.value = ""; + } }); } @@ -182,8 +186,12 @@ validate(){ let inputs = this.shadowRoot.querySelectorAll('#ironPages > *'); for (let i = 0; i < inputs.length; i++) { - if (inputs[i].validate && !inputs[i].validate()) - return false; + try { + if (!inputs[i].validate()) + return false; + } catch (e) { + + } } return true; } @@ -192,4 +200,4 @@ window.customElements.define(PtMultilangInput.is, PtMultilangInput); - + \ No newline at end of file