From 5f6560154db86af1d7d4a7ff3e9c77bef49e1acf Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Wed, 18 Aug 2021 18:52:34 +0530 Subject: [PATCH] #599 TopPanel x,y and dimension for element, doesn't work --- src/editor/components/seSpinInput.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/editor/components/seSpinInput.js b/src/editor/components/seSpinInput.js index 3aa391de..bd8c6cb6 100644 --- a/src/editor/components/seSpinInput.js +++ b/src/editor/components/seSpinInput.js @@ -179,6 +179,19 @@ export class SESpinInput extends HTMLElement { * @returns {void} */ connectedCallback () { + const shadow = this.$input.shadowRoot; + const childNodes = Array.from(shadow.childNodes); + childNodes.forEach( (childNode) => { + if(childNode?.id === "input") { + childNode.addEventListener('keyup', (e) => { + e.preventDefault(); + if (!isNaN(e.target.value)) { + this.value = e.target.value; + this.dispatchEvent(this.$event); + } + }); + } + }); this.$input.addEventListener('change', (e) => { e.preventDefault(); this.value = e.target.value;