Skip to content

Commit 4487277

Browse files
authored
fix: set boolean knob value using property (#102)
1 parent ce251a0 commit 4487277

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib/renderer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ const updateComponent = (
2626

2727
// Apply knobs using properties or attributes
2828
Object.keys(knobs).forEach((key: string) => {
29-
const { knobType, attribute, value, custom } = knobs[key];
29+
const { attribute, value, custom } = knobs[key];
3030
if (custom && attribute) {
3131
if (typeof value === 'string' && value) {
3232
component.setAttribute(attribute, value);
3333
} else {
3434
component.removeAttribute(attribute);
3535
}
36-
} else if (knobType === 'boolean') {
37-
component.toggleAttribute(attribute || key, Boolean(value));
3836
} else {
3937
(component as unknown as ComponentWithProps)[key] = value;
4038
}

0 commit comments

Comments
 (0)