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(Autocomplete): dont put text cursor to the end on every change event #1968

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

Chaoste
Copy link
Contributor

@Chaoste Chaoste commented Mar 22, 2022

Purpose of PR

See this comment. Downshift will always move the text cursor to the end of the input. Following the linked comment, we handle the change manually and thereby avoid the rerender (and cursor position change).

Before:

Screen.Recording.2022-03-22.at.17.56.45.mov

After:

Screen.Recording.2022-03-22.at.17.57.29.mov

I wrote a test but it always worked. The jumping cursor bug doesn't appear in the jsdom context.

PR Checklist

  • I have read the relevant readme.md file(s)
  • All commits follow our Git commit message convention
  • Tests are added/updated/not required
  • Tests are passing
  • Storybook stories are added/updated/not required
  • Usage notes are added/updated/not required
  • Has been tested based on Contentful's browser support
  • Doesn't contain any sensitive information

@vercel
Copy link

vercel bot commented Mar 22, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/contentful-apps/forma-36/3sJDgEUd15kPJsDJEXPzLXrM21Nq
✅ Preview: https://forma-36-git-fix-autocomplete-cursor-jump-contentful-apps.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Mar 22, 2022

⚠️ No Changeset found

Latest commit: da11466

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@burakukula burakukula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement! Thanks a lot! 🙌

@Chaoste Chaoste merged commit c75e798 into main Mar 23, 2022
@Chaoste Chaoste deleted the fix/autocomplete-cursor-jump branch March 23, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants