Skip to content

Commit

Permalink
[EuiInputPopover] Convert .defaultProps + a improve props documenta…
Browse files Browse the repository at this point in the history
…tion

- a few hard-coded props (that were present in the table) should have been defined in the destructure fallbacks, so that their defaults display in our docs prop table
  • Loading branch information
cee-chen committed Oct 18, 2023
1 parent 7721d8a commit 1b60ba2
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/components/popover/input_popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ export const EuiInputPopover: FunctionComponent<EuiInputPopoverProps> = ({
children,
className,
closePopover,
anchorPosition = 'downLeft',
attachToAnchor = true,
repositionToCrossAxis = false,
display = 'block',
panelPaddingSize = 's',
closeOnScroll = false,
ownFocus = false,
disableFocusTrap = false,
focusTrapProps,
input,
Expand Down Expand Up @@ -189,15 +195,19 @@ export const EuiInputPopover: FunctionComponent<EuiInputPopoverProps> = ({

return (
<EuiPopover
className={classes}
css={css(fullWidth ? undefined : logicalCSS('max-width', form.maxWidth))}
repositionToCrossAxis={false}
ownFocus={false}
display={display}
button={input}
buttonRef={inputRef}
panelRef={panelRef}
className={classes}
ref={popoverClassRef}
closePopover={closePopover}
anchorPosition={anchorPosition}
attachToAnchor={attachToAnchor}
repositionToCrossAxis={repositionToCrossAxis}
panelPaddingSize={panelPaddingSize}
ownFocus={ownFocus}
{...props}
panelProps={{ ...props.panelProps, onKeyDown }}
>
Expand All @@ -213,10 +223,3 @@ export const EuiInputPopover: FunctionComponent<EuiInputPopoverProps> = ({
</EuiPopover>
);
};

EuiInputPopover.defaultProps = {
anchorPosition: 'downLeft',
attachToAnchor: true,
display: 'block',
panelPaddingSize: 's',
};

0 comments on commit 1b60ba2

Please sign in to comment.