Skip to content

Commit 0a17b38

Browse files
committed
fix def value
1 parent aaa2da4 commit 0a17b38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PropertyGrid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,12 @@ export class PropertyGrid extends BaseCustomWebComponentConstructorAppend {
266266
const pInfo = <IProperty>node.data.property;
267267
const ctl = await this.getEditorForType(pInfo, currentValue, pPath, e);
268268
if (ctl) {
269-
if (pInfo.defaultValue && ctl instanceof HTMLInputElement && ctl.value == '' && !pInfo.nullable) {
269+
if (pInfo.defaultValue != null && ctl instanceof HTMLInputElement && ctl.value == '' && !pInfo.nullable) {
270270
if (ctl.type == 'text')
271271
ctl.placeholder = pInfo.defaultValue;
272272
else
273273
ctl.value = pInfo.defaultValue;
274-
} else if (pInfo.defaultValue && ctl instanceof HTMLSelectElement && ctl.value == '' && !pInfo.nullable) {
274+
} else if (pInfo.defaultValue != null && ctl instanceof HTMLSelectElement && ctl.value == '' && !pInfo.nullable) {
275275
ctl.value = pInfo.defaultValue;
276276
}
277277
ctl.style.flexGrow = '1';

0 commit comments

Comments
 (0)