Skip to content

Commit

Permalink
Merge pull request #3360 from sunniejai/master
Browse files Browse the repository at this point in the history
Pass focusedOption to the MenuList
  • Loading branch information
JedWatson authored Mar 19, 2021
2 parents 53371d5 + 035294f commit f3c0bb5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-laws-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-select": minor
---

Now pass the focusedOption to the MenuList Component as a prop
1 change: 1 addition & 0 deletions packages/react-select/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,7 @@ export default class Select extends Component<Props, State> {
}}
isLoading={isLoading}
maxHeight={maxHeight}
focusedOption={focusedOption}
>
{menuUI}
</MenuList>
Expand Down
3 changes: 3 additions & 0 deletions packages/react-select/src/components/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import type {
MenuPlacement,
MenuPosition,
CommonProps,
OptionType,
} from '../types';
import type { Theme } from '../types';

Expand Down Expand Up @@ -352,6 +353,8 @@ export type MenuListProps = {
children: Node,
/** Inner ref to DOM Node */
innerRef: InnerRef,
/** The currently focused option */
focusedOption: OptionType,
/** Props to be passed to the menu-list wrapper. */
innerProps: {},
};
Expand Down

0 comments on commit f3c0bb5

Please sign in to comment.