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 auto-scrolling issue when adding new lines #243

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Conversation

juliopavila
Copy link
Collaborator

Description:

closes #230

This PR addresses an odd UX behavior in the text editor. Before the fix, when a user was adding new lines at the bottom of the page, the editor didn't automatically scroll to the new line. Instead, it waited until the user began typing. This issue also affected pasted text, where the editor did not respond at all.

Changes include:

  • A new useEffect hook which updates the editor state to focus on the new line once it's created.
  • The addition of scrollIntoViewIfNeeded to ensure that the new line is brought into view when added, even if it's created by pasting text from the clipboard.

With these changes, the editor should now auto-scroll to a new line when it's created, improving the user experience.

Testing

Screen.Recording.2023-07-20.at.1.05.25.PM.mov

@juliopavila juliopavila changed the base branch from main to tabula-v.2.1 July 20, 2023 16:06
@vercel
Copy link

vercel bot commented Jul 20, 2023

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

Name Status Preview Comments Updated (UTC)
tabula ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 4:07pm

@juliopavila juliopavila merged commit bbc2435 into tabula-v.2.1 Jul 20, 2023
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 20, 2023
@juliopavila juliopavila deleted the issue-#230 branch May 28, 2024 20:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Page not scrolling to new lines unless there's a keypress
2 participants