-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: issue: [[https://linear.app/comm/issue/ENG-9472/nux-appears-outside-of-safe-area-on-android | ENG-9472]] On some Androids, we cannot measure a button that is not visible on the screen. `undefined`s are returned. So we have to wait of the login screen to be dismissed, before we call `measure`. I wanted to pass the `measure` function itseft through conxtext, but that results in `Cannot read property '_nativeTag' of undefined` error. Not sure what that means, but I don't think passing the ref is much worse. `measure` asynchronously measures the component and then calls the callback. This is by I need states and an effect, instead of a memo. `buttonMeasured` flag ensures the tip doesn't jump after the `measure` is done. `measure` returns quickly and I don't think this slight delay is a problem. Test Plan: Tested on Android 11 physical device, and iOS 17.4 simulator. Tesdted by updating `NUXHandlerInner` to run the effect on every app reaload. Checked that on both Android and iOS the NUX tips are displayed in the correct position. Checked thare are no odd visual effects, like jumping (thanks to `buttonMeasured`) Reviewers: tomek, kamil Reviewed By: tomek Subscribers: ashoat Differential Revision: https://phab.comm.dev/D13697
- Loading branch information
1 parent
7617de9
commit e43c6b9
Showing
4 changed files
with
122 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.