Skip to content

Commit

Permalink
[core] deprecate Portal stopPropagationEvents (#6632)
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya authored Jan 8, 2024
1 parent aaf1fa9 commit efb0a70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/components/overlay/overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ export interface OverlayableProps extends OverlayLifecycleProps {
* A list of DOM events which should be stopped from propagating through the Portal.
* This prop is ignored if `usePortal` is `false`.
*
* @deprecated this prop's implementation no longer works in React v17+
* @see https://legacy.reactjs.org/docs/portals.html#event-bubbling-through-portals
* @see https://github.com/palantir/blueprint/issues/6124
* @see https://github.com/palantir/blueprint/issues/6580
*/
portalStopPropagationEvents?: Array<keyof HTMLElementEventMap>;

Expand Down Expand Up @@ -313,6 +315,7 @@ export class Overlay extends AbstractPureComponent<OverlayProps, OverlayState> {
<Portal
className={this.props.portalClassName}
container={this.props.portalContainer}
// eslint-disable-next-line deprecation/deprecation
stopPropagationEvents={this.props.portalStopPropagationEvents}
>
{transitionGroup}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ export class Popover<
usePortal={usePortal}
portalClassName={this.props.portalClassName}
portalContainer={this.props.portalContainer}
// eslint-disable-next-line deprecation/deprecation
portalStopPropagationEvents={this.props.portalStopPropagationEvents}
shouldReturnFocusOnClose={shouldReturnFocusOnClose}
>
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/components/portal/portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export interface PortalProps extends Props {
/**
* A list of DOM events which should be stopped from propagating through this portal element.
*
* @deprecated this prop's implementation no longer works in React v17+
* @see https://legacy.reactjs.org/docs/portals.html#event-bubbling-through-portals
* @see https://github.com/palantir/blueprint/issues/6124
* @see https://github.com/palantir/blueprint/issues/6580
*/
stopPropagationEvents?: Array<keyof HTMLElementEventMap>;
}
Expand Down Expand Up @@ -75,6 +77,7 @@ const PORTAL_LEGACY_CONTEXT_TYPES: ValidationMap<PortalLegacyContext> = {
* @see https://blueprintjs.com/docs/#core/components/portal
*/
export function Portal(
// eslint-disable-next-line deprecation/deprecation
{ className, stopPropagationEvents, container, onChildrenMount, children }: PortalProps,
legacyContext: PortalLegacyContext = {},
) {
Expand Down

1 comment on commit efb0a70

@adidahiya
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[core] deprecate Portal stopPropagationEvents (#6632)

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.