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

fix: prioritize poppers position prop in overlaytrigger #6175

Merged
merged 4 commits into from Jan 6, 2022
Merged

fix: prioritize poppers position prop in overlaytrigger #6175

merged 4 commits into from Jan 6, 2022

Conversation

golota60
Copy link
Collaborator

@golota60 golota60 commented Jan 6, 2022

Fixes #6173. What was happening is that placement prop was being passed to BaseOverlay and then passed to the overlay prop, ignoring popper object, which in turn resulted in hard-coded the placement property

src/Overlay.tsx Outdated
@@ -181,18 +181,20 @@ const Overlay = React.forwardRef<HTMLElement, OverlayProps>(
>
{(overlayProps, { arrowProps, placement, popper: popperObj, show }) => {
wrapRefs(overlayProps, arrowProps);
// Need to get placement from popper object first, handling case when overlay is flipped using 'flip' prop
const updatedPlacement = popperObj?.placement || placement;
Copy link
Member

Choose a reason for hiding this comment

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

Hmm I wonder if we need to fallback to placement here.

I think(?) popper's placement should always be defined.

I think this might be enough const updatedPlacement = popperObj?.placement;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think you're right, will change

@golota60 golota60 merged commit dc9a0d7 into react-bootstrap:master Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arrow placement in overlay not working with flip modifier
2 participants