Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

- Deprecated `PartitionConfig` in favor of inclusion in Charts `theme.partition` ([#5492](https://github.com/elastic/eui/pull/5492))

**Breaking changes**

- Removed `popoverClassName` and `repositionOnScroll` props from `EuiSuperSelect` (use `popoverProps` instead) ([#5512](https://github.com/elastic/eui/pull/5512))

## [`43.1.1`](https://github.com/elastic/eui/tree/v43.1.1)

**Bug fixes**
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/flyout/flyout_complicated.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export default () => {
valueOfSelected={superSelectvalue}
onChange={(value) => onSuperSelectChange(value)}
itemLayoutAlign="top"
repositionOnScroll={true}
popoverProps={{ repositionOnScroll: true }}
hasDividers
/>
</EuiFormRow>
Expand Down
23 changes: 2 additions & 21 deletions src/components/form/super_select/super_select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,14 @@ export type EuiSuperSelectProps<T extends string> = CommonProps &

/**
* Optional props to pass to the underlying [EuiPopover](/#/layout/popover).
* Allows fine-grained control of the popover dropdown menu, including
* 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 & Omit<EuiPopoverProps, 'isOpen'>>;

/**
* Applied to the outermost wrapper (popover)
*
* **DEPRECATED: Use `popoverProps.className` instead (will take precedence over this prop if set).**
*/
popoverClassName?: string;

/**
* When `true`, the popover's position is re-calculated when the user
* scrolls. When nesting an `EuiSuperSelect` in a scrollable container,
* `repositionOnScroll` should be `true`
*
* **DEPRECATED: Use `popoverProps.repositionOnScroll` instead (will take precedence over this prop if set).**
*/
repositionOnScroll?: boolean;
};

export class EuiSuperSelect<T extends string> extends Component<
Expand Down Expand Up @@ -276,16 +260,14 @@ export class EuiSuperSelect<T extends string> extends Component<
itemClassName,
itemLayoutAlign,
fullWidth,
popoverClassName,
popoverProps,
compressed,
repositionOnScroll,
...rest
} = this.props;

const popoverClasses = classNames(
'euiSuperSelect',
popoverProps?.className ?? popoverClassName
popoverProps?.className
);

const buttonClasses = classNames(
Expand Down Expand Up @@ -346,7 +328,6 @@ export class EuiSuperSelect<T extends string> extends Component<
<EuiInputPopover
closePopover={this.closePopover}
panelPaddingSize="none"
repositionOnScroll={repositionOnScroll}
{...popoverProps}
className={popoverClasses}
isOpen={isOpen || this.state.isPopoverOpen}
Expand Down