fix: set aria label to ID

This commit is contained in:
MAZE 2023-10-27 12:51:45 +03:30
parent 01f4031812
commit 7e0a9afb17
2 changed files with 4 additions and 5 deletions

View File

@ -4,17 +4,16 @@ import styles from './range.module.css';
interface RangeProps {
id: string;
label: string;
}
export function Range({ id, label }: RangeProps) {
export function Range({ id }: RangeProps) {
const setVolume = useSoundStore(state => state.setVolume);
const volume = useSoundStore(state => state.sounds[id].volume);
const isSelected = useSoundStore(state => state.sounds[id].isSelected);
return (
<input
aria-labelledby={label}
aria-labelledby={id}
autoComplete="off"
className={styles.range}
disabled={!isSelected}

View File

@ -79,8 +79,8 @@ export function Sound({
>
<Like id={id} />
<div className={styles.icon}>{icon}</div>
<h3 id={label}>{label}</h3>
<Range id={id} label={label} />
<h3 id={id}>{label}</h3>
<Range id={id} />
</div>
);
}