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 jumpy html text input on iOS #115

Merged
merged 2 commits into from
Sep 10, 2018
Merged

Conversation

etoledom
Copy link
Contributor

This PR fixes an UX issue with the html text input on iOS, where the text scrolls up each time the text change.
jumpy_html_ios

This happens because, with the usual setState() setup, RN recreates the element when the state changes.

To fix it I decided to let the component itself manage its state, and later on retrieve the text from its reference, similar to how is usually done on native iOS. It would be great if there's a better way.

To test:

  • Run the project on iOS.
  • Switch to html editor.
  • Edit the text.
  • Check that the cursor won't jump to the top.
  • Check that the html changes are taken into account when switching back to blocks as described in Parse html into known blocks #100 (working just with registered Gutenberg blocks for now)

@etoledom etoledom self-assigned this Aug 14, 2018
@etoledom etoledom mentioned this pull request Aug 15, 2018
5 tasks
@mzorz
Copy link
Contributor

mzorz commented Aug 17, 2018

FYI restarted a failed Travis job and it's green now 👍

Copy link
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Good work.

@etoledom etoledom changed the base branch from feature/parse-html-into-blocks to master September 10, 2018 23:11
@etoledom etoledom merged commit ba7bceb into master Sep 10, 2018
@etoledom etoledom deleted the feature/html-input-view-ux-vol02 branch September 10, 2018 23:27
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.

3 participants