Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/blockly/core/field_image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@
return this.altText || null;
}

override computeAriaLabel(includeTypeInfo: boolean): string {
if (this.isClickable()) {
return '';
}
return super.computeAriaLabel(includeTypeInfo);
}

/**
* Recomputes the ARIA role and label for this field.
*/
Expand All @@ -338,7 +345,7 @@
this.isClickable() ? aria.Role.BUTTON : aria.Role.PRESENTATION,
);

const label = this.computeAriaLabel(true);
const label = this.isClickable() ? this.getAriaValue() || '' : super.computeAriaLabel(true);

Check failure on line 348 in packages/blockly/core/field_image.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `·?·this.getAriaValue()·||·''` with `⏎······?·this.getAriaValue()·||·''⏎·····`
aria.setState(focusableElement, aria.State.LABEL, label);
}
}
Expand Down
Loading