UI: Add aria-labelledby and data-testid to MultiCombobox (#109521)

Add aria-labelledby and data-testid props
This commit is contained in:
Andreas Christou
2025-08-12 14:06:04 +01:00
committed by GitHub
parent ce64b66798
commit 6c106a85ac
@@ -47,6 +47,8 @@ export const MultiCombobox = <T extends string | number>(props: MultiComboboxPro
maxWidth,
isClearable,
createCustomValue = false,
'aria-labelledby': ariaLabelledBy,
'data-testid': dataTestId,
} = props;
const styles = useStyles2(getComboboxStyles);
@@ -285,15 +287,17 @@ export const MultiCombobox = <T extends string | number>(props: MultiComboboxPro
)}
<input
className={multiStyles.input}
{...getInputProps(
getDropdownProps({
{...getInputProps({
...getDropdownProps({
disabled,
preventKeyAction: isOpen,
placeholder: visibleItems.length === 0 ? placeholder : '',
ref: inputRef,
style: { width: inputWidth },
})
)}
}),
'aria-labelledby': ariaLabelledBy, // Label should be handled with the Field component
'data-testid': dataTestId,
})}
/>
<div className={multiStyles.suffix} ref={suffixMeasureRef} {...getToggleButtonProps()}>