when setting a default value for a BOOLEAN type property it gets saved as string:
props:
parameters:
# my default value
- name: colorMode
default: false
label: Color Mode
description: Show Color mode as default or Temperature Mode
required: false
type: BOOLEAN
as long as the widget editor stays open the default value is a bool, but after closing and re-opening the Editor
for the widget, the default value is converted to string,
also the values gets sorted and any comments gets lost:
props:
parameters:
- default: "false"
description: Show Color mode as default or Temperature Mode
label: Color Mode
name: colorMode
required: false
type: BOOLEAN
Expected behavior
default value remains type BOOLEAN.
The code entered should not be changed or adapted during save as one does not see the result during editing (only after reopening the editor)
and code changes are not expected during save
Steps to reproduce
create new widget, and add first code snippet above
Save and exit edit
Open editor again, see result and compare with saved input
The problem
when setting a default value for a
BOOLEAN
type property it gets saved as string:as long as the widget editor stays open the default value is a bool, but after closing and re-opening the Editor
for the widget, the default value is converted to
string
, also the values gets sorted and any comments gets lost:Expected behavior
default value remains type BOOLEAN. The code entered should not be changed or adapted during save as one does not see the result during editing (only after reopening the editor) and code changes are not expected during save
Steps to reproduce
Your environment
Browser console
Browser network traffic
Additional information
related to changes for #990