Skip to content

Commit 141e28d

Browse files
authored
fix: Correct ARIA label is for invalid values. (#9469)
## The basics - [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change) ## The details ### Resolves Fixes #9466 ### Proposed Changes Ensures `FieldInput`'s ARIA labels are recomputed when an invalid value is attempted to be set. ### Reason for Changes Previously the `FieldInput` would continuously update its ARIA label as the value changed, including for invalid values. If the editor was cancelled this would correctly revert but if an invalid value was attempted to be saved then it would cancel the update but not correct the ARIA label. ### Test Coverage No new tests are needed for this experimental change. This has been manually verified locally using `FieldNumber` in Core's advanced playground. ### Documentation No documentation changes are needed for this experimental change. ### Additional Information None.
1 parent 6073b00 commit 141e28d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

core/field_input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
227227
const oldValue = this.value_;
228228
// Revert value when the text becomes invalid.
229229
this.value_ = this.valueWhenEditorWasOpened_;
230+
this.recomputeAriaLabel();
230231
if (
231232
this.sourceBlock_ &&
232233
eventUtils.isEnabled() &&

0 commit comments

Comments
 (0)