modal/button: prevent error when label is updated before the widget is fully created

This commit is contained in:
bordun 2020-11-22 18:05:18 +01:00
parent 332f3bbc65
commit 367a0ddbf9
3 changed files with 5 additions and 0 deletions

View file

@ -4,6 +4,7 @@
- bug fixes
- custom module / theme: prevent reloading the module while the file is being written to
- modal/button: prevent error when `label` is updated
- widgets
- encoder: add `ticks` property back

View file

@ -202,6 +202,8 @@ class Button extends Widget {
updateLabel() {
if (!this.label) return
if (this.getProp('label') === false) {
if (this.widget.contains(this.label)) this.widget.removeChild(this.label)

View file

@ -207,6 +207,8 @@ class Modal extends Panel {
updateLabel() {
if (!this.label) return
if (this.getProp('label') === false) {
if (this.container.contains(this.label)) this.container.removeChild(this.label)