From 0a17b3800405e66b985f530fc3e280ff28700e14 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Thu, 31 Oct 2024 00:47:02 +0100 Subject: [PATCH] fix def value --- src/PropertyGrid.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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';