fix: format of checkbox and radio control value
This commit is contained in:
@@ -712,7 +712,7 @@ export class Control {
|
|||||||
} else if (type === ControlType.CHECKBOX) {
|
} else if (type === ControlType.CHECKBOX) {
|
||||||
const checkbox = new CheckboxControl(element, this)
|
const checkbox = new CheckboxControl(element, this)
|
||||||
this.activeControl = checkbox
|
this.activeControl = checkbox
|
||||||
const codes = value?.split(',') || []
|
const codes = value ? value.split(',') : []
|
||||||
checkbox.setSelect(codes, controlContext, controlRule)
|
checkbox.setSelect(codes, controlContext, controlRule)
|
||||||
} else if (type === ControlType.RADIO) {
|
} else if (type === ControlType.RADIO) {
|
||||||
const radio = new RadioControl(element, this)
|
const radio = new RadioControl(element, this)
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export function mousedown(evt: MouseEvent, host: CanvasEvent) {
|
|||||||
if (!control) {
|
if (!control) {
|
||||||
draw.getCheckboxParticle().setSelect(curElement)
|
draw.getCheckboxParticle().setSelect(curElement)
|
||||||
} else {
|
} else {
|
||||||
const codes = control?.code?.split(',') || []
|
const codes = control?.code ? control.code.split(',') : []
|
||||||
if (checkbox?.value) {
|
if (checkbox?.value) {
|
||||||
const codeIndex = codes.findIndex(c => c === checkbox.code)
|
const codeIndex = codes.findIndex(c => c === checkbox.code)
|
||||||
codes.splice(codeIndex, 1)
|
codes.splice(codeIndex, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user