Skip to content

Commit 41c1f75

Browse files
authored
fix(react): downshift replacing id prop in dropdown (carbon-design-system#15241) (carbon-design-system#15249)
1 parent a640108 commit 41c1f75

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,13 @@ const Dropdown = React.forwardRef(
516516
item,
517517
index,
518518
});
519+
if (
520+
item !== null &&
521+
typeof item === 'object' &&
522+
Object.prototype.hasOwnProperty.call(item, 'id')
523+
) {
524+
itemProps.id = item['id'];
525+
}
519526
const title =
520527
isObject && 'text' in item && itemToElement
521528
? item.text

0 commit comments

Comments
 (0)