-
Notifications
You must be signed in to change notification settings - Fork 3k
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
#23546 - Wrong Image opens on HT Report in Safari #28441
Changes from 7 commits
35ae16a
3d4faa6
d1bf919
afcac5d
d10f9fd
6f41ef5
60ac519
5a19e1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ const viewabilityConfig = { | |
// To facilitate paging through the attachments, we want to consider an item "viewable" when it is | ||
// more than 95% visible. When that happens we update the page index in the state. | ||
itemVisiblePercentThreshold: 95, | ||
minimumViewTime: 300, | ||
}; | ||
|
||
function AttachmentCarousel({report, reportActions, parentReportActions, source, onNavigate, setDownloadButtonVisibility, translate, transaction}) { | ||
|
@@ -195,16 +196,17 @@ function AttachmentCarousel({report, reportActions, parentReportActions, source, | |
disableIntervalMomentum | ||
pagingEnabled | ||
snapToAlignment="start" | ||
snapToInterval={containerWidth} | ||
contentInset={{top: 0, left: 0, bottom: 0, right: 0}} | ||
contentInsetAdjustmentBehavior="automatic" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this? Can you please explain the issue it solves? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check my comment here |
||
snapToOffsets={_.map(attachments, (__, index) => index * containerWidth)} | ||
// Enable scrolling by swiping on mobile (touch) devices only | ||
// disable scroll for desktop/browsers because they add their scrollbars | ||
// Enable scrolling FlatList only when PDF is not in a zoomed state | ||
scrollEnabled={canUseTouchScreen} | ||
ref={scrollRef} | ||
initialScrollIndex={page} | ||
initialNumToRender={3} | ||
windowSize={5} | ||
maxToRenderPerBatch={CONST.MAX_TO_RENDER_PER_BATCH.CAROUSEL} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did we remove this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recently, the 'maxToRenderPerBatch' was set to use a constant, but we have removed it in this PR |
||
initialNumToRender={1} | ||
windowSize={1} | ||
data={attachments} | ||
CellRendererComponent={AttachmentCarouselCellRenderer} | ||
renderItem={renderItem} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be default value. Any reason for adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I recall from my tests on platforms, such as macOS desktop and iOS native, I found that without explicitly setting this value (despite it being the default), the view appeared slightly different (with a 1-2px padding)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add that as a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done