Skip to content

Commit 7a3af80

Browse files
authored
fix: Remove extra and problematic ARIA settings (#9478)
## The basics - [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change) ## The details ### Resolves Fixes #9461 ### Proposed Changes Remove image-specific ARIA properties (role and label) for the current selected item in `FieldDropdown`. ### Reason for Changes This intentionally changes a behavior introduced in #9384 because the alternative ARIA behavior works better. As the images in #9461 show the actual focus outline when the current drop-down value has ARIA properties goes to that element (separate from active focus in this case) since the screen reader will read out those properties. However, this makes the reader lose context on the combo box itself. This basically goes away from leveraging active descendant (though that's still necessary for correct combo box implementation) and just forces the label in a way that keeps the combo box context. Text-based combo boxes already do this, so this change simply brings image-based items in alignment with text combo box behaviors. ### Test Coverage No new automated tests are needed for this experimental change. Manual testing was done via core Blockly's advanced playground (using the 'test blocks' toolbox). ### Documentation No documentation changes are needed. ### Additional Information None.
1 parent 141e28d commit 7a3af80

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

core/field_dropdown.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,6 @@ export class FieldDropdown extends Field<string> {
624624
const element = this.getFocusableElement();
625625
aria.setState(element, aria.State.ACTIVEDESCENDANT, imageElement.id);
626626
}
627-
628-
aria.setRole(imageElement, aria.Role.IMAGE);
629-
aria.setState(imageElement, aria.State.LABEL, imageJson.alt);
630627
}
631628

632629
/** Renders the selected option, which must be text. */

0 commit comments

Comments
 (0)