Skip to content

Commit

Permalink
fix def value
Browse files Browse the repository at this point in the history
  • Loading branch information
jogibear9988 committed Oct 30, 2024
1 parent aaa2da4 commit 0a17b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PropertyGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ export class PropertyGrid extends BaseCustomWebComponentConstructorAppend {
const pInfo = <IProperty>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';
Expand Down

0 comments on commit 0a17b38

Please sign in to comment.