Skip to content

Commit b300d09

Browse files
committed
fix: take inputprops out of usememo
1 parent 093bcff commit b300d09

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
@@ -90,16 +90,17 @@ export function MultiSelection({
9090
});
9191

9292
const inputLabel = getInputLabel(options.inputId);
93+
const ariaLabelledBy = inputProps["aria-labelledby"];
9394
const ariaLabels = useMemo(
9495
() =>
9596
getComboboxAriaLabels({
9697
hasSelection: selectedItems.length > 0,
9798
selectedValue: selectedItems.map(id => selector.caption.get(id)).join(", "),
9899
inputLabel,
99-
labelledBy: inputProps["aria-labelledby"],
100+
labelledBy: ariaLabelledBy,
100101
fallbackAriaLabel: options.ariaLabel
101102
}),
102-
[selectedItems, inputLabel, inputProps, options.ariaLabel, selector.caption]
103+
[selectedItems, inputLabel, ariaLabelledBy, options.ariaLabel, selector.caption]
103104
);
104105

105106
return (

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

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

8484
const inputLabel = getInputLabel(options.inputId);
85+
const ariaLabelledBy = inputProps["aria-labelledby"];
8586
const ariaLabels = useMemo(
8687
() =>
8788
getComboboxAriaLabels({
8889
hasSelection: Boolean(selectedItem),
8990
selectedValue: selectedItem ? selector.caption.get(selectedItem) : "",
9091
inputLabel,
91-
labelledBy: inputProps["aria-labelledby"],
92+
labelledBy: ariaLabelledBy,
9293
fallbackAriaLabel: options.ariaLabel
9394
}),
94-
[selectedItem, inputLabel, inputProps, options.ariaLabel, selector.caption]
95+
[selectedItem, inputLabel, ariaLabelledBy, options.ariaLabel, selector.caption]
9596
);
9697

9798
return (

0 commit comments

Comments
 (0)