Skip to content

Commit 9be2479

Browse files
validate field
1 parent 226849f commit 9be2479

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/FormSelectList/CheckboxView.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ export default {
8181
getOptionAriaLabel(option) {
8282
let ariaLabel = '';
8383
if (this.optionsExtra?.length) {
84-
const optionExtra = this.optionsExtra.find(extra => extra[this.optionValue] === option[this.optionValue]);
85-
ariaLabel = optionExtra[this.optionAriaLabel || "ariaLabel"];
84+
const optionExtra = this.optionsExtra.find(extra =>
85+
extra.hasOwnProperty(this.optionValue) &&
86+
extra[this.optionValue] === option[this.optionValue]);
87+
if (optionExtra) {
88+
ariaLabel = optionExtra[this.optionAriaLabel || "ariaLabel"] ?? '';
89+
}
8690
} else {
87-
ariaLabel = option[this.optionAriaLabel || "ariaLabel"];
91+
ariaLabel = option[this.optionAriaLabel || "ariaLabel"] ?? '';
8892
}
8993
return (!ariaLabel || ariaLabel === "") ? this.getOptionContent(option) : ariaLabel;
9094
},

0 commit comments

Comments
 (0)