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 { interface RangeProps {
id: string; id: string;
label: string;
} }
export function Range({ id, label }: RangeProps) { export function Range({ id }: RangeProps) {
const setVolume = useSoundStore(state => state.setVolume); const setVolume = useSoundStore(state => state.setVolume);
const volume = useSoundStore(state => state.sounds[id].volume); const volume = useSoundStore(state => state.sounds[id].volume);
const isSelected = useSoundStore(state => state.sounds[id].isSelected); const isSelected = useSoundStore(state => state.sounds[id].isSelected);
return ( return (
<input <input
aria-labelledby={label} aria-labelledby={id}
autoComplete="off" autoComplete="off"
className={styles.range} className={styles.range}
disabled={!isSelected} disabled={!isSelected}

View File

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