mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
fix: Fix exception thrown when FieldDropdown subclasses don't have a textual label. (#9401)
This commit is contained in:
@@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user