Commit 178d94d
authored
fix(iOS): restore behaviour of RNSScreenStackAnimationNone (#2565)
## Description
There is still some header animation noticeable for some reason. <--
This is because we use `fade` transition with duration 0 and do not
override interruptible animator! To prevent the animation we could
either return `nil` interruptible animator (but overriding the method
comes with it's own set of problems, see #2563 and other related) or
handle the `none` animation much earlier, when calling
`showViewControllers:animated:` in `updateContainer` (pass `animated:
NO`).
PS: If we would want to pass `animated: NO` I wonder what would happen
to dismiss prevention - we implemented it at the stage of the animation
start... We need to think this through.
Note: Must be implemented with old animation API, because
`UIViewPropertyAnimator` does not allow for 0 duration (it uses default
if the specified animation duration is below some undocumented
treshold).
This regression was introduced with #2477
## Changes
We now use old API for `animation: none` & still rely on fade animation
to implement it. Note the points made above ☝🏻 - we should refactor this
code to make advantage of `animated:` parameter of the
`showViewControllers:animated:`.
## Test code and steps to reproduce
`TestAnimation` - set stack presentation to `none` - it works as prior
to v4.
WIP VIDEO
## Checklist
- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Updated documentation: <!-- For adding new props to native-stack
-->
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [ ] Ensured that CI passes1 parent 6e37c7e commit 178d94d
File tree
3 files changed
+70
-26
lines changed- apps/src/tests
- ios
3 files changed
+70
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | | - | |
86 | | - | |
| 91 | + | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
| |||
489 | 483 | | |
490 | 484 | | |
491 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
492 | 518 | | |
493 | 519 | | |
494 | 520 | | |
| |||
509 | 535 | | |
510 | 536 | | |
511 | 537 | | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
527 | 566 | | |
528 | | - | |
529 | | - | |
530 | 567 | | |
531 | 568 | | |
532 | 569 | | |
| |||
0 commit comments