Skip to content

Commit 2f3fee3

Browse files
committed
fix: take inputprops out of usememo
1 parent 9439275 commit 2f3fee3

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/pluggableWidgets/combobox-web/src/components/MultiSelection/MultiSelection.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,17 @@ export function MultiSelection({
9898
});
9999

100100
const inputLabel = getInputLabel(options.inputId);
101+
const ariaLabelledBy = inputProps["aria-labelledby"];
101102
const ariaLabels = useMemo(
102103
() =>
103104
getComboboxAriaLabels({
104105
hasSelection: selectedItems.length > 0,
105106
selectedValue: selectedItems.map(id => selector.caption.get(id)).join(", "),
106107
inputLabel,
107-
labelledBy: inputProps["aria-labelledby"],
108+
labelledBy: ariaLabelledBy,
108109
fallbackAriaLabel: options.ariaLabel
109110
}),
110-
[selectedItems, inputLabel, inputProps, options.ariaLabel, selector.caption]
111+
[selectedItems, inputLabel, ariaLabelledBy, options.ariaLabel, selector.caption]
111112
);
112113

113114
return (

packages/pluggableWidgets/combobox-web/src/components/SingleSelection/SingleSelection.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,17 @@ export function SingleSelection({
8484
);
8585

8686
const inputLabel = getInputLabel(options.inputId);
87+
const ariaLabelledBy = inputProps["aria-labelledby"];
8788
const ariaLabels = useMemo(
8889
() =>
8990
getComboboxAriaLabels({
9091
hasSelection: Boolean(selectedItem),
9192
selectedValue: selectedItem ? selector.caption.get(selectedItem) : "",
9293
inputLabel,
93-
labelledBy: inputProps["aria-labelledby"],
94+
labelledBy: ariaLabelledBy,
9495
fallbackAriaLabel: options.ariaLabel
9596
}),
96-
[selectedItem, inputLabel, inputProps, options.ariaLabel, selector.caption]
97+
[selectedItem, inputLabel, ariaLabelledBy, options.ariaLabel, selector.caption]
9798
);
9899

99100
return (

0 commit comments

Comments
 (0)