Skip to content

Commit

Permalink
Give the lock icon an accessible label
Browse files Browse the repository at this point in the history
  • Loading branch information
robintown committed Nov 21, 2023
1 parent fcfb818 commit 09481d1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/room/EncryptionLock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ interface Props {
export const EncryptionLock: FC<Props> = ({ encrypted }) => {
const { t } = useTranslation();
const Icon = encrypted ? LockIcon : LockOffIcon;
const label = encrypted ? t("common.encrypted") : t("common.unencrypted");

return (
<Tooltip
label={encrypted ? t("common.encrypted") : t("common.unencrypted")}
side="right"
>
<Tooltip label={label} side="right">
<Icon
width={16}
height={16}
className={styles.lock}
data-encrypted={encrypted}
aria-label={label}
// Make the icon focusable so that the tooltip can be opened
// with keyboard navigation
// TODO: Replace this with the solution from
Expand Down

0 comments on commit 09481d1

Please sign in to comment.