Skip to content

Commit f65b43e

Browse files
committed
form.field.CheckBox: getGroupValue() => only query for fields which have a name / path #5972
1 parent c91be35 commit f65b43e

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/form/field/CheckBox.mjs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,19 @@ class CheckBox extends Base {
456456
*/
457457
getGroupValue() {
458458
let form = this.getClosestForm(),
459-
fields = ComponentManager.find({path: this.getPath()}),
460-
value = [];
459+
path = this.getPath(),
460+
value = [],
461+
fields;
461462

462-
fields.forEach(field => {
463-
if (field.checked && field.getClosestForm() === form) {
464-
NeoArray.add(value, field.value)
465-
}
466-
});
463+
if (path) {
464+
fields = ComponentManager.find({path});
465+
466+
fields.forEach(field => {
467+
if (field.checked && field.getClosestForm() === form) {
468+
NeoArray.add(value, field.value)
469+
}
470+
})
471+
}
467472

468473
return value
469474
}

0 commit comments

Comments
 (0)