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

#599 TopPanel x,y and dimension for element, doesn't work issue fixed
master
JFH 2021-08-19 09:47:26 +02:00 committed by GitHub
commit 62ea8a0cda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

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;