Skip to content

Commit

Permalink
Add back compat and deprecation message for __unstableForcePosition
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Aug 25, 2022
1 parent 7bbbcdf commit 7b9952a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/components/src/popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const Popover = (
__unstableFlip = true,
__unstableResize = true,
__unstableShift = false,
__unstableForcePosition = false,
...contentProps
},
forwardedRef
Expand All @@ -158,6 +159,20 @@ const Popover = (
} );
}

if ( __unstableForcePosition ) {
deprecated( '__unstableForcePosition prop in Popover component', {
since: '6.1',
version: '6.3',
alternative:
'`__unstableFlip={ false }` and `__unstableResize={ false }`',
} );

// Back-compat, set the `__unstableFlip` and `__unstableResize` props
// to `false` to replicate `__unstableForcePosition`.
__unstableFlip = false;
__unstableResize = false;
}

const arrowRef = useRef( null );
const anchorRefFallback = useRef( null );

Expand Down

0 comments on commit 7b9952a

Please sign in to comment.