diff --git a/src/PropertyGrid.ts b/src/PropertyGrid.ts index 6dcb745..818570b 100644 --- a/src/PropertyGrid.ts +++ b/src/PropertyGrid.ts @@ -266,12 +266,12 @@ export class PropertyGrid extends BaseCustomWebComponentConstructorAppend { const pInfo = node.data.property; const ctl = await this.getEditorForType(pInfo, currentValue, pPath, e); if (ctl) { - if (pInfo.defaultValue && ctl instanceof HTMLInputElement && ctl.value == '' && !pInfo.nullable) { + if (pInfo.defaultValue != null && ctl instanceof HTMLInputElement && ctl.value == '' && !pInfo.nullable) { if (ctl.type == 'text') ctl.placeholder = pInfo.defaultValue; else ctl.value = pInfo.defaultValue; - } else if (pInfo.defaultValue && ctl instanceof HTMLSelectElement && ctl.value == '' && !pInfo.nullable) { + } else if (pInfo.defaultValue != null && ctl instanceof HTMLSelectElement && ctl.value == '' && !pInfo.nullable) { ctl.value = pInfo.defaultValue; } ctl.style.flexGrow = '1';