Skip to content

Commit bbd60b9

Browse files
annawen1kennylam
andauthored
fix(dropdown): revert memoization of togglebuttonprops (#19176)
Co-authored-by: kennylam <[email protected]>
1 parent a12ebae commit bbd60b9

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

packages/react/src/components/Dropdown/Dropdown.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,9 @@ const Dropdown = React.forwardRef(
501501

502502
// needs to be Capitalized for react to render it correctly
503503
const ItemToElement = itemToElement;
504-
const toggleButtonProps = useMemo(
505-
() =>
506-
getToggleButtonProps({
507-
'aria-label': ariaLabel || deprecatedAriaLabel,
508-
}),
509-
[getToggleButtonProps, ariaLabel, deprecatedAriaLabel, isOpen]
510-
);
504+
const toggleButtonProps = getToggleButtonProps({
505+
'aria-label': ariaLabel || deprecatedAriaLabel,
506+
});
511507

512508
const helper =
513509
helperText && !isFluid ? (
@@ -687,13 +683,6 @@ const Dropdown = React.forwardRef(
687683
item,
688684
index,
689685
});
690-
if (
691-
item !== null &&
692-
typeof item === 'object' &&
693-
Object.prototype.hasOwnProperty.call(item, 'id')
694-
) {
695-
itemProps.id = item['id'];
696-
}
697686
const title =
698687
isObject && 'text' in item && itemToElement
699688
? item.text

0 commit comments

Comments
 (0)