Skip to content

Commit

Permalink
[PR feedback] Remove isOpen prop from being
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 27, 2021
1 parent 541a548 commit 6edbf98
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Updated `EuiRangeLevel` `color` property to accept CSS color values ([#5171](https://github.com/elastic/eui/pull/5171))
- Deprecated `EuiSuperSelect`'s `popoverClassName`, `isOpen`, & `repositionOnScroll` props in favor of a single `popoverProps` configuration object ([#5214](https://github.com/elastic/eui/pull/5214))
- Deprecated `EuiSuperSelect`'s `popoverClassName` & `repositionOnScroll` props in favor of a single `popoverProps` configuration object ([#5214](https://github.com/elastic/eui/pull/5214))

**Bug fixes**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ exports[`EuiSuperSelect props renders popoverProps on the underlying EuiPopover
popoverProps={
Object {
"className": "goes-on-outermost-wrapper",
"isOpen": false,
"panelClassName": "goes-on-popover-panel",
"repositionOnScroll": true,
}
Expand Down
1 change: 0 additions & 1 deletion src/components/form/super_select/super_select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ describe('EuiSuperSelect', () => {
className: 'goes-on-outermost-wrapper',
panelClassName: 'goes-on-popover-panel',
repositionOnScroll: true,
isOpen: false,
}}
/>
);
Expand Down
23 changes: 12 additions & 11 deletions src/components/form/super_select/super_select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,20 @@ export type EuiSuperSelectProps<T extends string> = CommonProps &
itemLayoutAlign?: EuiContextMenuItemLayoutAlignment;

/**
* Props to pass to the underlying [EuiPopover](/#/layout/popover). Allows
* fine-grained control of the popover dropdown menu, including `isOpen` state,
* Controls whether the options are shown. Default: false
*/
isOpen?: boolean;

/**
* Optional props to pass to the underlying [EuiPopover](/#/layout/popover).
* Allows fine-grained control of the popover dropdown menu, including
* `repositionOnScroll` for EuiSuperSelects used within scrollable containers,
* and customizing popover panel styling.
*
* Does not accept a nested `popoverProps.isOpen` property - use the top level
* `isOpen` API instead.
*/
popoverProps?: Partial<CommonProps & EuiPopoverProps>;
popoverProps?: Partial<CommonProps & Omit<EuiPopoverProps, 'isOpen'>>;

/**
* Applied to the outermost wrapper (popover)
Expand All @@ -83,13 +91,6 @@ export type EuiSuperSelectProps<T extends string> = CommonProps &
*/
popoverClassName?: string;

/**
* Controls whether the options are shown. Default: false
*
* **DEPRECATED: Use `popoverProps.isOpen` instead (will take precedence over this prop if set).**
*/
isOpen?: boolean;

/**
* When `true`, the popover's position is re-calculated when the user
* scrolls. When nesting an `EuiSuperSelect` in a scrollable container,
Expand Down Expand Up @@ -338,12 +339,12 @@ export class EuiSuperSelect<T extends string> extends Component<

return (
<EuiInputPopover
isOpen={isOpen || this.state.isPopoverOpen}
closePopover={this.closePopover}
panelPaddingSize="none"
repositionOnScroll={repositionOnScroll}
{...popoverProps}
className={popoverClasses}
isOpen={isOpen || this.state.isPopoverOpen}
input={button}
fullWidth={fullWidth}
>
Expand Down

0 comments on commit 6edbf98

Please sign in to comment.