Skip to content

Fix(#3716,#3815): Prevent layout shift while using typeahead menu - #3826

Merged
thegreatercurve merged 1 commit into
meta:mainfrom
blacktoast:fix-layoutshift-using-textahead
Feb 7, 2023
Merged

thegreatercurve merged 1 commit into
meta:mainfrom
blacktoast:fix-layoutshift-using-textahead

Conversation

@blacktoast

Copy link
Copy Markdown
Contributor

resolve #3716 and #3815

Problem

When the amount of a document is more than one page and when users use the typeahead menu in the middle of the document, the layout shifts

Solution

Kapture 2023-02-05 at 22 33 28

Note

  1. I changed the if else statement into an early return statement

  2. I removed parentNode, because the previous parentNode was very similar to the target node.

  3. I made typeaheadContainerNode for detecting the typeahead menu out of the viewport

- parent node val is same to target, so remove parent node val
- add typeaheadContainerNode for focusing popover
@vercel

vercel Bot commented Feb 5, 2023 •

Copy link
Copy Markdown

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

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 5, 2023 at 3:14PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 5, 2023 at 3:14PM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 5, 2023
@thegreatercurve

Copy link
Copy Markdown
Contributor

Great work! Thanks @blacktoast!

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 1635162b Deployed Feb 5, 2023 by vercel[bot]
Preview – lexical — 1635162b Deployed Feb 5, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Layout shifts while using typeahead menu

3 participants