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: iOS not firing resize event #2438

Closed

Conversation

rawalyogendra
Copy link
Contributor

Fixes #2430

This is related to iOS devices not firing resize event when keyboard opens/closes.

The workaround is listening to window.visualViewport resize event and updating the height and width by the values returned by window.visualViewport

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 23, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ce5be31:

Sandbox Source
react-native-web-examples Configuration
inspiring-maxwell-z05zbt Issue #2430

@necolas
Copy link
Owner

necolas commented Nov 23, 2022

I think this should fallback to the existing object if visualViewport is not supported

@rawalyogendra
Copy link
Contributor Author

@necolas I have added the previous implementation as fallback. All tests are passing.

@flodnv
Copy link

flodnv commented Nov 29, 2022

@necolas could you please review this PR? 🙏

@mananjadhav
Copy link

mananjadhav commented Dec 1, 2022

@necolas Anyway we can help to get this merged sooner? 🙇

@flodnv
Copy link

flodnv commented Dec 8, 2022

@necolas any chance you can have one more look at this soon? 🙏 We're happy to sponsor you, either through this GH repo or through an upwork job along with other existing upwork jobs from Expensify/App#11463

@necolas
Copy link
Owner

necolas commented Dec 8, 2022

Please update the unit tests to cover the new branching logic. Thanks

@necolas necolas added this to the 0.18.x milestone Dec 8, 2022
@rawalyogendra
Copy link
Contributor Author

@necolas wanted to clear something with you.

For the unit test:

  • Should I update the existing tests to cover our new VisualViewport implementation? or
  • Should I add new tests to cover the implementation on top of the old tests? or
  • Are you suggesting something else?

@necolas
Copy link
Owner

necolas commented Dec 12, 2022

Yes both branches should be covered by tests. You've added a new branch but have not added tests

@rawalyogendra
Copy link
Contributor Author

@necolas I am not sure about the best way to test these new changes.

But I have added the tests nonetheless. Let me know if we could do this in a better way.

@flodnv
Copy link

flodnv commented Jan 13, 2023

@necolas any further thoughts on this change? 🙏

@necolas
Copy link
Owner

necolas commented Jan 25, 2023

Thanks. I deleted the extra tests because they were just checking the fallback path

@flodnv
Copy link

flodnv commented Jan 26, 2023

Thank you @necolas !

@rawalyogendra rawalyogendra deleted the safari-dimesion-resize branch January 26, 2023 18:22
necolas pushed a commit that referenced this pull request Jun 16, 2023
Fixes `window.height` and `window.width` so that they do not change when
pinch-zoomed. This issue was introduced by #2438 when `documentElement`
measurements were replaced by `visualViewport`.

Close #2520
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.

Dimensions change event is not fired on iOS (Safari)
4 participants