Skip to content

Commit

Permalink
Merge pull request #418 from lifeomic/ror-426-set-popover-style
Browse files Browse the repository at this point in the history
feat: add optional popoverStyle param to Select
  • Loading branch information
aymanenadi authored Aug 30, 2024
2 parents f69f83d + b134d1a commit d41b33d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { generateUniqueId } from '../_private/UniqueId';
import { Text } from '../Text';
import { SelectOptionProps, SelectSecondaryAction } from './SelectOption';
import { motion, useReducedMotion } from 'framer-motion';
import { motion, MotionStyle, useReducedMotion } from 'framer-motion';
import { RoverOption } from './RoverOption';
import { useRoverState } from 'reakit/Rover';
import { getTestProps } from '../../testUtils/getTestProps';
Expand Down Expand Up @@ -359,6 +359,7 @@ export interface SelectProps
tooltipMessage?: string;
/** This property shows the required asterisk (*). Required validation needs to be implemented separately. */
showRequiredLabel?: boolean;
popoverStyle?: MotionStyle;
}

/**
Expand Down Expand Up @@ -408,6 +409,7 @@ export const Select: React.FC<SelectProps> = ({
tooltipMessage,
value,
showRequiredLabel,
popoverStyle,
...rootProps
}) => {
const classes = useStyles({});
Expand Down Expand Up @@ -606,7 +608,7 @@ export const Select: React.FC<SelectProps> = ({
aria-label={label || ariaLabel || popoverAriaLabel}
className={classes.popover}
{...popover}
style={{ width }}
style={{ width, ...(popoverStyle || {}) }}
as={motion.div}
animate={popover.visible ? 'open' : 'closed'}
variants={
Expand Down

0 comments on commit d41b33d

Please sign in to comment.