diff --git a/CHANGELOG.md b/CHANGELOG.md index 87699c0b..18507e64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/client/widgets/basics/button.js b/src/client/widgets/basics/button.js index 19b736c5..cd334012 100644 --- a/src/client/widgets/basics/button.js +++ b/src/client/widgets/basics/button.js @@ -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) diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index 06ec8edf..453ef2c2 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -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)