diff --git a/src/editor/core/draw/control/Control.ts b/src/editor/core/draw/control/Control.ts index 231a023..1efcc76 100644 --- a/src/editor/core/draw/control/Control.ts +++ b/src/editor/core/draw/control/Control.ts @@ -712,7 +712,7 @@ export class Control { } else if (type === ControlType.CHECKBOX) { const checkbox = new CheckboxControl(element, this) this.activeControl = checkbox - const codes = value?.split(',') || [] + const codes = value ? value.split(',') : [] checkbox.setSelect(codes, controlContext, controlRule) } else if (type === ControlType.RADIO) { const radio = new RadioControl(element, this) diff --git a/src/editor/core/event/handlers/mousedown.ts b/src/editor/core/event/handlers/mousedown.ts index b0ec76f..d3cc682 100644 --- a/src/editor/core/event/handlers/mousedown.ts +++ b/src/editor/core/event/handlers/mousedown.ts @@ -91,7 +91,7 @@ export function mousedown(evt: MouseEvent, host: CanvasEvent) { if (!control) { draw.getCheckboxParticle().setSelect(curElement) } else { - const codes = control?.code?.split(',') || [] + const codes = control?.code ? control.code.split(',') : [] if (checkbox?.value) { const codeIndex = codes.findIndex(c => c === checkbox.code) codes.splice(codeIndex, 1)