Skip to content

Commit 47f7237

Browse files
committed
fixes
1 parent b25412f commit 47f7237

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PropertyGrid.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ 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 as HTMLInputElement).value == '' && !pInfo.nullable) {
270-
(ctl as HTMLInputElement).placeholder = pInfo.defaultValue;
271-
} else if (pInfo.defaultValue && (ctl as HTMLSelectElement).value == '' && !pInfo.nullable) {
272-
(ctl as HTMLSelectElement).value = pInfo.defaultValue;
269+
if (pInfo.defaultValue && ctl instanceof HTMLInputElement && ctl.value == '' && !pInfo.nullable) {
270+
ctl.placeholder = pInfo.defaultValue;
271+
} else if (pInfo.defaultValue && ctl instanceof HTMLSelectElement && ctl.value == '' && !pInfo.nullable) {
272+
ctl.value = pInfo.defaultValue;
273273
}
274274
ctl.style.flexGrow = '1';
275275
ctl.style.width = '100%';

0 commit comments

Comments
 (0)