Add checkId() for PyButton and PyInputBox, add id check for tags with pys- Event handlers (#400)

* Add id generation to PyButton and PyInputBox components

* Refactor init handlers and add check for id
This commit is contained in:
Yannick Funk
2022-05-16 23:05:11 +02:00
committed by GitHub
parent ca909b4f6b
commit eba42ad9b4
3 changed files with 28 additions and 13 deletions

View File

@@ -37,6 +37,7 @@ export class PyButton extends BaseEvalElement {
}
connectedCallback() {
this.checkId();
this.code = htmlDecode(this.innerHTML);
this.mount_name = this.id.split('-').join('_');
this.innerHTML = '';