From 533af7521b7415ba0d1fa532e60f6a192a112345 Mon Sep 17 00:00:00 2001 From: bordun Date: Sat, 25 Jan 2020 15:13:13 +0100 Subject: [PATCH] editor: set `label` to `auto` instead of `true` when using the toggle button --- CHANGELOG.md | 3 ++- src/client/app/editor/edit-field.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 317f338f..a49085ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## 0.48.9 - bug fixes: - - missing `target` property for `plots/*` widgets, required for MIDI bindings + - widgets: missing `target` property for `plots/*` widgets, required for MIDI bindings + - editor: set `label` to `auto` instead of `true` when using the toggle button - widgets: - **new** `menu` widget, circular alternative to the dropdown & switch widgets - editor: diff --git a/src/client/app/editor/edit-field.js b/src/client/app/editor/edit-field.js index 6a926956..6e788bab 100644 --- a/src/client/app/editor/edit-field.js +++ b/src/client/app/editor/edit-field.js @@ -78,7 +78,12 @@ module.exports = function editField(editor, widget, propName, defaultValue){ ` toggle.addEventListener('click', ()=>{ - input.value = !widget.getProp(propName) + if (propName === 'label' && !widget.getProp(propName) === true) { + // special case + input.value = 'auto' + } else { + input.value = !widget.getProp(propName) + } DOM.dispatchEvent(input, 'change') })