Skip to content

Conversation

LudvigGislason
Copy link
Contributor

I noticed that passing the prop resetScrollToCoords didn't seem to have an effect, it kept scrolling to 0, 0 whatever I passed in.

I looked into the code and saw that the _resetKeyboardSpace in KeyboardAwareHOC was checking for this.resetCoords if this.props.enableResetScrollToCoords was not equal to false and then falling back to defaultResetScrollToCoords if defined, otherwise it simply scrolled to 0,0.

I failed to find any place where resetCoords is set and I assume what we want to use here are the coordinates passed through the resetScrollToCoords prop.

The suggested fix in this pull request gives me the results I would expect for the following scenarios:

  • enableResetScrollToCoords={false}: scrolls to 0,0.
  • resetScrollToCoords={{ x: 0, y: 100 }}: scrolls to 0,100 when enableResetScrollToCoords is true or default.
  • None of these props passed: scrolls to the default of 0,0 as it previously did.

@alvaromb
Copy link
Collaborator

Can you change resetCoords here also

resetCoords: ?{ x: number, y: number }
?

@LudvigGislason
Copy link
Contributor Author

Sure!

@alvaromb alvaromb merged commit e8d528f into APSL:master Dec 10, 2018
@alvaromb
Copy link
Collaborator

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