Skip to content

Commit

Permalink
fix: πŸ› [Select] Keys for options on top level component
Browse files Browse the repository at this point in the history
βœ… Closes: 248
  • Loading branch information
luciob committed May 3, 2022
1 parent e3a2666 commit b6e7da7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Select/components/Option/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const SelectOption = <T extends any>({
}, [checkboxDataCy, customContent, labelDataCy, optionLabel, multiple, selected]);

return (
<li key={optionDataCy} data-cy={optionDataCy} {...forwarded}>
<li data-cy={optionDataCy} {...forwarded}>
{content}
</li>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ const Select = <T extends any>({

const renderOption = useCallback(
(props: HTMLAttributes<HTMLLIElement>, option: T, { selected }: MUIAutocompleteRenderOptionState) => {
const { id: key } = props;
return (
<SelectOption
key={key}
customRenderer={renderCustomOption}
dataCy={dataCy}
forwarded={props}
Expand Down

0 comments on commit b6e7da7

Please sign in to comment.