fix: Fix exception thrown when FieldDropdown subclasses don't have a textual label. (#9401)

This commit is contained in:
Aaron Dodson
2025-10-03 10:55:21 -07:00
committed by GitHub
parent bf576d5bc3
commit 0eec0e0cd6

View File

@@ -217,11 +217,13 @@ export class FieldDropdown extends Field<string> {
// Ensure the selected item has its correct label presented since it may be
// different than the actual text presented to the user.
aria.setState(
this.getTextElement(),
aria.State.LABEL,
this.computeLabelForOption(this.selectedOption),
);
if (this.textElement_) {
aria.setState(
this.textElement_,
aria.State.LABEL,
this.computeLabelForOption(this.selectedOption),
);
}
}
/**