Skip to content

Commit 0eec0e0

Browse files
authored
fix: Fix exception thrown when FieldDropdown subclasses don't have a textual label. (#9401)
1 parent bf576d5 commit 0eec0e0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/field_dropdown.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,13 @@ export class FieldDropdown extends Field<string> {
217217

218218
// Ensure the selected item has its correct label presented since it may be
219219
// different than the actual text presented to the user.
220-
aria.setState(
221-
this.getTextElement(),
222-
aria.State.LABEL,
223-
this.computeLabelForOption(this.selectedOption),
224-
);
220+
if (this.textElement_) {
221+
aria.setState(
222+
this.textElement_,
223+
aria.State.LABEL,
224+
this.computeLabelForOption(this.selectedOption),
225+
);
226+
}
225227
}
226228

227229
/**

0 commit comments

Comments
 (0)