From f19eb00175a913082c851c5f38ee16ae13d6f491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20L=C3=B3pez=20Lugo?= Date: Tue, 16 Jan 2018 00:01:25 -0400 Subject: [PATCH] General Improvements --- pt-multilang-input.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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