Skip to content

settingsDialog: default value type of checkbox and radio to boolean? #94

@northword

Description

@northword

Currently, if a checkbox-type item does not have a valueType set, it defaults to returning the strings "true" and "false". I think we should default to returning boolean values instead. What do you think?

case "input": {
const inputElement = element as HTMLInputElement;
if (inputElement.type === "checkbox" || inputElement.type === "radio") {
rawValue = inputElement.checked;
} else {
rawValue = inputElement.value;
}
break;
}

      case "input": {
        const inputElement = element as HTMLInputElement;
        if (inputElement.type === "checkbox" || inputElement.type === "radio") {
---          rawValue = inputElement.checked;
+++          rawValue = Boolean(inputElement.checked);
        } else {
          rawValue = inputElement.value;
        }
        break;
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions