fix(audio-devices): fix index as pos in set

Signed-off-by: Joshua Irmer <irmer@gonicus.de>
This commit is contained in:
Joshua Irmer
2025-04-01 16:29:02 +02:00
committed by Saúl Ibarra Corretgé
parent a3d89ea66f
commit 2ec3cfcb9e
2 changed files with 7 additions and 5 deletions

View File

@@ -29,9 +29,10 @@ interface IProps {
hasError?: boolean;
/**
* Flag indicating if there is a problem with the device.
* Index of the device item used to generate this entry.
* Indexes are 0 based.
*/
index?: number;
index: number;
/**
* Flag indicating the selection state.
@@ -190,7 +191,7 @@ const MicrophoneEntry = ({
return (
<li
aria-checked = { isSelected }
aria-posinset = { index }
aria-posinset = { index + 1 } // Add one to offset the 0 based index.
aria-setsize = { length }
className = { classes.container }
onClick = { onClick }

View File

@@ -25,7 +25,8 @@ interface IProps {
deviceId: string;
/**
* Flag controlling the selection state of the entry.
* Index of the device item used to generate this entry.
* Indexes are 0 based.
*/
index: number;
@@ -139,7 +140,7 @@ const SpeakerEntry = (props: IProps) => {
return (
<li
aria-checked = { isSelected }
aria-posinset = { index }
aria-posinset = { index + 1 } // Add one to offset the 0 based index.
aria-setsize = { length }
className = { classes.container }
onClick = { _onClick }