Open lanitochka17 opened 3 days ago
Triggered auto assignment to @trjExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Job added to Upwork: https://www.upwork.com/jobs/~021859724558833397121
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External
)
Edited by proposal-police: This proposal was edited at 2024-11-22 07:32:34 UTC.
Attachment preview slides to the right with a delay when dismissed
The modal dismissal was triggered before the attachment carousel animation completed. This caused a conflict between the animation lifecycle and modal dismissal, leading to visual inconsistencies.
This happens only on iOS native because its native modal animations run concurrently with Animated.FlatList, leading to conflicts. iOS enforces stricter rendering and animation synchronization, exposing timing issues.
To resolve this issue, we must delay dismissing the modal until the animation of the attachment carousel is completed. This ensures that all active interactions, including animations and gestures, are finished before the modal is dismissed, avoiding conflicts between the animation lifecycle and modal dismissal. Something like this:
//src/pages/home/report/ReportAttachments.tsx#L55
<AttachmentModal
accountID={Number(accountID)}
type={type}
allowDownload
defaultOpen
report={report}
source={source}
onModalClose={() => {
+ InteractionManager.runAfterInteractions(() => {
+ requestAnimationFrame(() => {
Navigation.dismissModal();
// This enables Composer refocus when the attachments modal is closed by the browser navigation
ComposerFocusManager.setReadyToFocus();
+ });
+ });
}}
onCarouselAttachmentChange={onCarouselAttachmentChange}
shouldShowNotFoundPage={!isLoadingApp && type !== CONST.ATTACHMENT_TYPE.SEARCH && !report?.reportID}
isAuthTokenRequired={!!isAuthTokenRequired}
attachmentLink={attachmentLink ?? ''}
originalFileName={fileName ?? ''}
/>
Note: We can write this code specifically for iOS using Platform.OS === 'ios' or by creating an index.ios.ts file. We will discuss and implement this approach during the PR phase
Attachment preview slides to the right with a delay when dismissed. Part of the current attachment followed by previously opened attachment can be seen for a couple of seconds on the right side of the screen
When pressing back button:
AttachmentModal
is closed before AttachmentCarousel
finishes unmounting, which causes visual bug.
The same bug appears on TransactionReceiptPage
as well:
https://github.com/user-attachments/assets/97ba5a7d-356b-4d13-b9f4-6f2cb14bba22
Wrap onModalClose
function with InteractionManager.runAfterInteractions
:
onModalClose={() => {
InteractionManager.runAfterInteractions(() => {
Navigation.dismissModal();
// This enables Composer refocus when the attachments modal is closed by the browser navigation
ComposerFocusManager.setReadyToFocus();
});
}}
Apply the same for TransactionReceiptPage
as well:
onModalClose={() => {
InteractionManager.runAfterInteractions(() => {
onModalClose();
});
}}
Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.65-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5249444 Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Attachment preview can be dismissed without delay
Actual Result:
Attachment preview slides to the right with a delay when dismissed. Part of the current attachment followed by previously opened attachment can be seen for a couple of seconds on the right side of the screen
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/5495074b-2e9b-46ab-939a-0a589efd92b2
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @thesahindia