editor: set label to auto instead of true when using the toggle button

This commit is contained in:
bordun 2020-01-25 15:13:13 +01:00
parent d42394c420
commit 533af7521b
2 changed files with 8 additions and 2 deletions

View file

@ -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:

View file

@ -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')
})