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

Floating element flickers / flips continuously on overflow due to appearing scrollbars #2822

Open
m3l1x opened this issue Mar 20, 2024 · 1 comment

Comments

@m3l1x
Copy link

m3l1x commented Mar 20, 2024

Describe the bug A clear and concise description of what the bug is.
Floating element with flip middleware flickers while resizing the window / flips continuously to the opposite site for the width of the appearing scrollbar when it overflows the viewport. By overflowing of the right boundary a vertical scrollbar is being automatically triggered due to width: 100vw and height: 100vh on any element.

To Reproduce
https://codesandbox.io/p/sandbox/ecstatic-kowalevski-n5wrdc?file=%2Fsrc%2Findex.js

Steps to reproduce the behavior:

  1. Go to the provided sandbox
  2. Slowly move the editor sash to reduce embedded window size
  3. As soon as the floating element begins to overflow, it starts to flip from right to left and vice versa until the appearing/disappearing scrollbar does not affect floating-uis logic for "bestFit"
  4. When you stop resizing in the described area, it happens that the flipping continues infinitely.

Expected behavior A clear and concise description of what you expected to
happen.
Floating element should not flip, if it would trigger an overflow

Screenshots If applicable, add screenshots to help explain your problem.
screenshot_floating

Context:

  • OS: Windows
  • Browser: Chrome 123.0.6312.59, Firefox 124.0
@atomiks
Copy link
Collaborator

atomiks commented Mar 21, 2024

triggered due to width: 100vw and height: 100vh on any element.

I don't think this particular issue can be fixed easily. I recommend using the size middleware to prevent it from overflowing in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants