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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 .show() for iOS and autofocus must always remeasure #27729

Merged
merged 6 commits into from Apr 16, 2020

Conversation

samouri
Copy link
Member

@samouri samouri commented Apr 13, 2020

summary
When showing a hidden element, we must remeasure that element as well as everything below it (via relayoutTop). I just found an edge case where we miss the remeasurement, which would cause all the elements below the shown one to have stale (and incorrect) measurements.

The bug only strikes if all three conditions are met:

  • On an iOS device
  • Calling .show() with a target that is not an amp element (e.g. a div)
  • Element we are showing requires autofocus

@samouri samouri self-assigned this Apr 13, 2020
@samouri samouri changed the title 馃悰 .show() bugfix: always measure 馃悰 .show() for iOS and autofocus must always remeasure Apr 13, 2020
@samouri
Copy link
Member Author

samouri commented Apr 14, 2020

Tests for this are passing locally for me. Something weird is happening :/

@samouri samouri force-pushed the opt-show branch 2 times, most recently from 93556b7 to f5fb0f4 Compare April 15, 2020 06:52
@samouri
Copy link
Member Author

samouri commented Apr 15, 2020

Giving up on figuring out why fn.toString() works locally but not on travis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants