question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support customized reference rectangle in preventOverflow modifier

See original GitHub issue

Feature description

preventOverflow modifier gets reference rectangle directly. Maybe it could use the reference rectangle from state.

Why should this feature be part of the Popper’s core?

I tried to use plugin inlinePositioning for Tippy together with preventOverflow modifier The plugin customizes the way how reference rectangle is evaluated, but when preventOverflow modifier is used, it places the content incorrectly

I tracked it down to this line where detectOverflow gets the reference rectangle directly:

https://github.com/popperjs/popper-core/blob/671f71e2b6990765e5ca780daaea7d1f7175beb6/src/utils/detectOverflow.js#L66

By examining popperOffsets it looks like it uses state.rects.reference, so I am wondering whether the preventOverflow modifier could use the same.

https://github.com/popperjs/popper-core/blob/671f71e2b6990765e5ca780daaea7d1f7175beb6/src/modifiers/popperOffsets.js#L11

Not sure if feature or bug, don’t know the internals enough to tell whether the problem is in how Tippy plugin is written or in Popper modifier, neither have enough knowledge to be able to reproduce it on a clean CodePen for just Popper.

Please advise

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
FezVrastacommented, Nov 3, 2020

We could make boundary and altBoundary accept a function with state as argument so one can compute the parent they like the most. I’d accept a PR to add this functionality.

0reactions
atomikscommented, Dec 9, 2021

Hi, we’re closing all feature requests related to Popper as it is entering low maintenance mode. All feature requests should now relate to the new package, Floating UI!

(This is now supported in Floating UI as it reads from the rect, but you’d probably use a Virtual Element)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support customized reference rectangle in preventOverflow ...
Now I need to find out how to properly set it up to use the actual scrolling parent and not the parent with...
Read more >
Support customized reference rectangle in preventOverflow modifier
By examining popperOffsets it looks like it uses state.rects.reference , so I am wondering whether the preventOverflow modifier could use the same. https:// ......
Read more >
Prevent Overflow - Popper
The preventOverflow modifier prevents the popper from being cut off by moving it so that it stays visible within its boundary area.
Read more >
list-job-templates — AWS CLI 1.27.19 Command Reference
The following list-job-templates example lists all custom job ... The service uses the output name modifier to create unique names for the ...
Read more >
010 Editor - Release Notes - SweetScape Software
The Workspace now supports multi-select and drag and drop. ... The custom starting address is used in the Hex Editor, status bar, goto,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found