mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-19 22:29:51 +03:00
add aria-label to buttons and text fields with no label #2710
This commit is contained in:
@@ -44,7 +44,7 @@ const LANGUAGE_OPTIONS: LanguageOption[] = [
|
||||
];
|
||||
|
||||
const LanguageSelector = () => {
|
||||
const { setLocale, locale } = useContext(I18nContext);
|
||||
const { setLocale, locale, LL } = useContext(I18nContext);
|
||||
|
||||
const onLocaleSelected: ChangeEventHandler<HTMLInputElement> = useCallback(
|
||||
async ({ target }) => {
|
||||
@@ -72,6 +72,7 @@ const LanguageSelector = () => {
|
||||
<TextField
|
||||
name="locale"
|
||||
variant="outlined"
|
||||
aria-label={LL.LANGUAGE()}
|
||||
value={locale}
|
||||
onChange={onLocaleSelected}
|
||||
size="small"
|
||||
|
||||
@@ -25,7 +25,11 @@ const ValidatedPasswordField: FC<ValidatedPasswordFieldProps> = ({ ...props }) =
|
||||
input: {
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton onClick={togglePasswordVisibility} edge="end">
|
||||
<IconButton
|
||||
onClick={togglePasswordVisibility}
|
||||
edge="end"
|
||||
aria-label="Password visibility"
|
||||
>
|
||||
{showPassword ? <VisibilityIcon /> : <VisibilityOffIcon />}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
|
||||
@@ -21,7 +21,7 @@ const ValidatedTextField: FC<ValidatedTextFieldProps> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<TextField error={!!errors} {...rest} />
|
||||
<TextField error={!!errors} {...rest} aria-label="Error" />
|
||||
{errors?.map((e) => (
|
||||
<FormHelperText key={e.message}>{e.message}</FormHelperText>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user