diff --git a/src/ActionList/Selection.tsx b/src/ActionList/Selection.tsx index 78ed43c2a1c..96ba447b2ef 100644 --- a/src/ActionList/Selection.tsx +++ b/src/ActionList/Selection.tsx @@ -1,16 +1,18 @@ import React from 'react' import {CheckIcon} from '@primer/octicons-react' -import {ListContext, ActionListProps} from './List' +import {ListContext} from './List' import {ActionListItemProps} from './shared' import {LeadingVisualContainer} from './Visuals' +import {GroupContext} from './Group' type SelectionProps = Pick export const Selection: React.FC> = ({selected}) => { + const {selectionVariant: groupSelectionVariant} = React.useContext(GroupContext) const {selectionVariant: listSelectionVariant} = React.useContext(ListContext) /** selectionVariant in Group can override the selectionVariant in List root */ /** fallback to selectionVariant from container menu if any (ActionMenu, SelectPanel ) */ - const selectionVariant: ActionListProps['selectionVariant'] = listSelectionVariant + const selectionVariant = groupSelectionVariant ?? listSelectionVariant if (!selectionVariant) { // if selectionVariant is not set on List, but Item is selected