Merge pull request #617 from SVG-Edit/issues/599

#599 TopPanel x,y and dimension for element, doesn't work issue fixed
This commit is contained in:
JFH
2021-08-19 09:47:26 +02:00
committed by GitHub

View File

@@ -184,6 +184,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;