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

[core] deprecate Portal stopPropagationEvents #6632

Merged
merged 3 commits into from
Jan 8, 2024
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
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