Skip to content

Commit

Permalink
accessibility improved for itwin/imodel grid tiles (#137)
Browse files Browse the repository at this point in the history
* added role and aria label for accessibility to tiles

* Create nm-acessible-tiles_2025-01-10-00-19.json

* onClick shifted
  • Loading branch information
nimam-bentley authored Jan 10, 2025
1 parent 44536c1 commit 143c4b4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/imodel-browser-react",
"comment": "added accessibility to grid tiles",
"type": "patch"
}
],
"packageName": "@itwin/imodel-browser-react"
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export const ITwinTile = ({
moreOptions={moreOptions}
thumbnail={
<div
aria-label={onThumbnailClick ? strings.navigateToITwin : ""}
role="button"
aria-label={
onThumbnailClick ? `${strings.navigateToITwin} ${iTwin?.id}` : ""
}
onClick={() => onThumbnailClick?.(iTwin)}
style={{ cursor: onThumbnailClick ? "pointer" : "auto" }}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,31 @@ export const IModelThumbnail = ({
inView ? accessToken : undefined,
apiOverrides
);
return thumbnail ? (
<img
className={classNames("iac-thumbnail", className)}
style={{
cursor: onClick ? "pointer" : "auto",
width: "100%",
}}
id="base64image"
src={thumbnail ?? ""}
alt=""
return (
<div
role="button"
aria-label={`Select iModel ${iModelId}`}
onClick={() => onClick?.(iModelId)}
/>
) : (
<Text
as="p"
variant="body"
ref={ref}
isSkeleton={true}
style={{ height: "100%", width: "100%", margin: 0 }}
></Text>
>
{thumbnail ? (
<img
className={classNames("iac-thumbnail", className)}
style={{
width: "100%",
}}
id="base64image"
src={thumbnail ?? ""}
alt=""
/>
) : (
<Text
as="p"
variant="body"
ref={ref}
isSkeleton={true}
style={{ height: "100%", width: "100%", margin: 0 }}
></Text>
)}
</div>
);
};

0 comments on commit 143c4b4

Please sign in to comment.