Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Popover): remove deprecated props #8201

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 1 addition & 16 deletions packages/react-core/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ReactElement } from 'react';
import { FocusTrap } from '../../helpers';
import { Popper, getOpacityTransition } from '../../helpers/Popper/Popper';
import { getUniqueId } from '../../helpers/util';
import { Instance as TippyInstance, Props as TippyProps } from '../../helpers/Popper/DeprecatedTippyTypes';
import { Instance as TippyInstance } from '../../helpers/Popper/DeprecatedTippyTypes';

export enum PopoverPosition {
auto = 'auto',
Expand Down Expand Up @@ -60,10 +60,6 @@ export interface PopoverProps {
* bodyContent={hide => <Button onClick={() => hide()}>Close</Button>}
*/
bodyContent: React.ReactNode | ((hide: () => void) => React.ReactNode);
/** @deprecated - no longer used. if you want to constrain the popper to a specific element
* use the appendTo prop instead.
*/
boundary?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;
/**
* The reference element to which the popover is relatively placed to. If you cannot wrap
* the reference with the Popover, you can use the reference prop instead.
Expand Down Expand Up @@ -215,8 +211,6 @@ export interface PopoverProps {
shouldOpen?: (showFunction?: () => void, event?: MouseEvent | KeyboardEvent) => void;
/** Flag indicating whether the close button should be shown. */
showClose?: boolean;
/** @deprecated - no longer used. */
tippyProps?: Partial<TippyProps>;
/** Whether to trap focus in the popover. */
withFocusTrap?: boolean;
/** The z-index of the popover. */
Expand Down Expand Up @@ -265,21 +259,12 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
animationDuration = 300,
id,
withFocusTrap: propWithFocusTrap,
boundary,
tippyProps,
reference,
hasNoPadding = false,
hasAutoWidth = false,
removeFindDomNode = false,
...rest
}: PopoverProps) => {
if (process.env.NODE_ENV !== 'production') {
boundary !== undefined &&
console.warn(
'The Popover boundary prop has been deprecated. If you want to constrain the popper to a specific element use the appendTo prop instead.'
);
tippyProps !== undefined && console.warn('The Popover tippyProps prop has been deprecated and is no longer used.');
}
// could make this a prop in the future (true | false | 'toggle')
// const hideOnClick = true;
const uniqueId = id || getUniqueId();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Popover } from '@patternfly/react-core';
import React, { Component } from 'react';
import { Instance as TippyInstance } from '@patternfly/react-core/dist/esm/helpers/Popper/DeprecatedTippyTypes';

export class PopoverDemo extends Component {
popoverRef: React.RefObject<HTMLButtonElement>;
Expand Down Expand Up @@ -30,13 +29,6 @@ export class PopoverDemo extends Component {
>
{this.myPopoverProps.children}
</Popover>
<Popover
bodyContent="test deprecated props"
tippyProps={{ duration: 0, delay: 0 }}
shouldClose={(tip: TippyInstance) => !tip}
>
<button>Trigger</button>
</Popover>
<div>
<button id="popover-selector">Popover attached via selector ref</button>
<Popover
Expand Down