mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
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.
This commit is contained in:
@@ -227,6 +227,7 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
|
||||
const oldValue = this.value_;
|
||||
// Revert value when the text becomes invalid.
|
||||
this.value_ = this.valueWhenEditorWasOpened_;
|
||||
this.recomputeAriaLabel();
|
||||
if (
|
||||
this.sourceBlock_ &&
|
||||
eventUtils.isEnabled() &&
|
||||
|
||||
Reference in New Issue
Block a user