Skip to content

fix: ui elements shifting to the right #5758

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

Closed
wants to merge 3 commits into from
Closed

fix: ui elements shifting to the right #5758

wants to merge 3 commits into from

Conversation

phanendraguptha
Copy link
Contributor

The main layout elements are shifting to the right when the search bar is open

before:

Untitled1.mp4

after:

Untitled2.mp4

@facebook-github-bot
Copy link
Collaborator

Hi @phanendraguptha!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@github-actions
Copy link

github-actions bot commented Mar 19, 2023

Size Changes

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

This PR introduced no changes to the javascript bundle 🙌

@facebook-github-bot
Copy link
Collaborator

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@gaearon
Copy link
Member

gaearon commented Mar 21, 2023

Is there any more natural way to do this?

Why does the scrollbar disappear underneath the model? Can we fix that instead?

@phanendraguptha
Copy link
Contributor Author

If the scrollbar appears, it means that the main content below the modal can be scrolled, which is not desirable since we disable scrolling when the popup modal opens. This causes the scrollbar to disappear, similar to using overflow: hidden.

@phanendraguptha
Copy link
Contributor Author

On further investigation, I found that @docsearch/react is adding a class DocSearch--active to the body element. Which is making the scrollbar hide and they are using overflow: hidden to do that. When we remove that class, the main content below the modal can be scrolled.

@phanendraguptha
Copy link
Contributor Author

@gaearon please let me know your thoughts on this.

@phanendraguptha
Copy link
Contributor Author

Hi,

The issue causing layout shifts due to the scrollbar disappearing has been fixed in the latest version of the Algolia DocSearch package (fix: #2378).

To resolve the problem in this repository, please consider bumping the DocSearch version to 3.8.0 (or the latest available). This will ensure the layout remains stable when the search bar modal is opened.

Thank you!

Copy link

vercel bot commented Jan 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
19-react-dev ❌ Failed (Inspect) Jan 26, 2025 7:47am
react-dev ❌ Failed (Inspect) Jan 26, 2025 7:47am

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

Successfully merging this pull request may close these issues.

3 participants