Add landmarks (#564)
Use HTML semantic elements to set the landmarks of the page. This is helpful for assistive technologies to determine the different regions of content. In our case it's useful for jumping between the different islands that we use to group the form controls.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function LanguageList<T>({
|
||||
onClick,
|
||||
@@ -9,12 +10,15 @@ export function LanguageList<T>({
|
||||
onClick: (value: string) => void;
|
||||
currentLanguage: string;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<select
|
||||
className="language-select"
|
||||
onChange={({ target }) => onClick(target.value)}
|
||||
value={currentLanguage}
|
||||
aria-label={t("buttons.selectLanguage")}
|
||||
>
|
||||
{languages.map(language => (
|
||||
<option key={language.lng} value={language.lng}>
|
||||
|
||||
@@ -51,6 +51,7 @@ export function LockIcon(props: LockIconProps) {
|
||||
id={props.id}
|
||||
onChange={props.onChange}
|
||||
checked={props.checked}
|
||||
aria-label={props.title}
|
||||
/>
|
||||
<div className="ToolIcon__icon">
|
||||
{props.checked ? ICONS.CHECKED : ICONS.UNCHECKED}
|
||||
|
||||
Reference in New Issue
Block a user