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

Attachment Carousel Virtual Caching #16973

Conversation

kidroca
Copy link
Contributor

@kidroca kidroca commented Apr 5, 2023

Details

Add a virtual list to the carousel component that is used to display attachments in the message view.
This allows us to render (and preload) a large number of attachments without having to render them all at once.
Now navigating between attachments is instant because we preload the next attachment in the background.

Fixed Issues

$ #15922
PROPOSAL: #15922 (comment)

Tests

Preparation

  1. Open a report with a lot of attachments (I used the #announce channel from ECX)
  2. Open an attachment

Things to check

  • Navigate between attachments using the left and right arrows works
  • If we wait for a second before pressing "Next Arrow" - the attachment is preloaded when you navigate to it
  • Going back to a previous attachment is instant (they are loaded from cache almost instantly)
  • On mobile devices (including mobile web) swiping works, and we can navigate between attachments
  • Open an attachment from the "middle" works (not the first or last attachment)
    • scroll to the past and select an attachment
    • the attachment view / carousel should open with the correct attachment
    • navigating between attachments should move to neighboring attachments
  • On mobile (including mobile web), taping on the carousel should toggle between showing and hiding the navigation arrows
  • Downloading attachment still works and downloads the correct attachment

Offline tests

Offline behavior is same as before:

  • images would appear to be loading forever (visible spinner)
  • Images that were seen got cached and should appear even when offline

QA Steps

The following steps are for both STAGING and PRODUCTION environments and all platforms

Preparation

  1. Open a report with a lot of attachments (I used the #announce channel from ECX)
  2. Open an attachment

Things to check

  • Navigate between attachments using the left and right arrows works
  • If we wait for a second before pressing "Next Arrow" - the attachment is preloaded when you navigate to it
  • Going back to a previous attachment is instant (they are loaded from cache almost instantly)
  • On mobile devices (including mobile web) swiping works, and we can navigate between attachments
  • Open an attachment from the "middle" works (not the first or last attachment)
    • scroll to the past and select an attachment
    • the attachment view / carousel should open with the correct attachment
    • navigating between attachments should move to neighboring attachments
  • On mobile (including mobile web), taping on the carousel should toggle between showing and hiding the navigation arrows
  • Downloading attachment still works and downloads the correct attachment

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
1.New.Expensify.-.Google.Chrome.2023-04-05.22-18-37.mp4
Screen.Recording.2023-04-06.at.19.17.56.mov
Mobile Web - Chrome
Android.Emulator.-.Pixel_4_API_31_5554.2023-04-05.22-14-56.mp4
Mobile Web - Safari
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-04-06.at.19.20.07.mp4
Desktop
Screen.Recording.2023-04-06.at.19.17.18.mov
iOS
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-04-06.at.19.12.30.mp4
Android
Android.Emulator.-.Pixel_4_API_31_5554.2023-04-05.21-58-57.mp4

@kidroca kidroca force-pushed the kidroca/fix/attachment-carousel-virtual-caching branch 2 times, most recently from 138a15f to 27e498b Compare April 5, 2023 20:44
Copy link
Contributor Author

@kidroca kidroca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some notes on the changes

@@ -75,14 +90,28 @@ class AttachmentCarousel extends React.Component {
getAttachment(attachmentItem) {
const source = _.get(attachmentItem, 'source', '');
const file = _.get(attachmentItem, 'file', {name: ''});
this.props.onNavigate({source: addEncryptedAuthTokenToURL(source), file});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This side effect was moved to the appropriate place - at the updatePage method - it shouldn't be in a getter

Comment on lines -142 to 170
if ((deltaSlide > 0 && this.state.isForwardDisabled) || (deltaSlide < 0 && this.state.isBackDisabled)) {
const nextIndex = this.state.page - deltaSlide;
const nextItem = this.state.attachments[nextIndex];

if (!nextItem) {
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the delta > 0 || < 0 checks are simplified:
We try to access an item - if the computed index returns an item - we use otherwise not

(This also lets us remove isForwardDisabled and isBackDisabled from local state)

Comment on lines -146 to +175
this.setState(({attachments, page}) => {
const nextIndex = page - deltaSlide;
const {source, file} = this.getAttachment(attachments[nextIndex]);
return {
page: nextIndex,
source,
file,
isBackDisabled: nextIndex === attachments.length - 1,
isForwardDisabled: nextIndex === 0,
};
});
// The sliding transition is a bit too much on web, because of the wider and bigger images,
// so we only enable it for mobile
this.scrollRef.current.scrollToIndex({index: nextIndex, animated: this.canUseTouchScreen});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state update was moved to updatePage

Here we only tell the view to scroll, which in turn would trigger updatePage and update the state

Comment on lines +206 to +218
// Touch screen devices can toggle between showing and hiding the arrows by tapping on the image/container
// Other devices toggle the arrows through hovering (mouse) instead (see render() root element)
if (!this.canUseTouchScreen) {
// eslint-disable-next-line react/jsx-props-no-spreading
return <View {...props} style={style} />;
}

return (
<Pressable
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
onPress={() => this.setState(current => ({shouldShowArrow: !current.shouldShowArrow}))}
style={style}
/>
);
Copy link
Contributor Author

@kidroca kidroca Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something I picked up while reviewing the onPress of CarouselActions I moved it here as it was the only thing left for CarouselActions/index.native.js

Having the Pressable wrap the FlatList is undesirable because it interferes with swiping - now we're no longer wrapping Attachments (FlatList) with Pressable (CarouselActions)

onCycleThroughAttachments={this.cycleThroughAttachments}
>
<AttachmentView
onPress={() => this.toggleArrowsVisibility(!this.state.shouldShowArrow)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up refactor - the onPress prop seem to have been added to the AttchmentView and then all the child view that it renders (Image, Pdf, ...) for the arrow functionality

There are no more usages of AttachmentView with onPress, so we can remove it (as well as the other views like ImageView)

@kidroca kidroca marked this pull request as ready for review April 5, 2023 20:52
@kidroca kidroca requested a review from a team as a code owner April 5, 2023 20:52
@melvin-bot melvin-bot bot requested review from johnmlee101 and thesahindia and removed request for a team April 5, 2023 20:52
@MelvinBot
Copy link

@johnmlee101 @thesahindia One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@thesahindia
Copy link
Member

That looks neat! Also thanks for the additional changes.

I just noticed few things while testing -

  • It's not possible to scroll the pages of pdf file
  • If we swipe left or right with two fingers on mac trackpad the attachment will shake
  • If we zoom an image and go to the next image then go back, the previous image remains in its zoomed-in position

@kidroca
Copy link
Contributor Author

kidroca commented Apr 11, 2023

  • It's not possible to scroll the pages of pdf file

Which platform - I don't have a problem on iOS, Chrome, Desktop, mobile web. I'll test Android tomorrow

  • If we swipe left or right with two fingers on mac trackpad the attachment will shake

This is because of the snap to alignment feature, I'll look into it

  • If we zoom an image and go to the next image then go back, the previous image remains in its zoomed-in position

This is from successful virtualization - the image doesn't reload, it's properties aren't changed it's just moved into view.
If we want to fix this we'll have to come up with some special logic that rests only the zoom level when items scroll out of view

For such a small bug I wouldn't risk adding complex logic to try and fix it

Large `updateCellsBatchingPeriod` values affect negatively swiping
because view is getting added and removed and this causes the list
content to shift

When we don't set `updateCellsBatchingPeriod` this happens quicker
and is less if even noticeable
These changes were necessary to alleviate a bug that happened because image width/height
would briefly be set to 0 and there was a noticeable jump while scrolling

At some point the issue disappeared on its own, probably because of less re-renders
We can't guarantee the carousel will always be as wide as the
window, so it's better to use the containing layout width

For example
On web/desktop the carousel is not rendered in a fullscreen modal
and is slightly smaller than the whole window width
@kidroca kidroca force-pushed the kidroca/fix/attachment-carousel-virtual-caching branch from 27e498b to 62678f7 Compare April 12, 2023 10:34
@kidroca
Copy link
Contributor Author

kidroca commented Apr 12, 2023

  • It's not possible to scroll the pages of pdf file
  • If we swipe left or right with two fingers on mac trackpad the attachment will shake

I've pushed a fix for these 2 items


Regarding the issue with resetting zoom

  • If we zoom an image and go to the next image then go back, the previous image remains in its zoomed-in position

I found out how to rest zoom for images, but not for PDF documents

I would prefer to address this in a separate PR as it would require a bit more changes and testing
Like an isVisible prop added to the AttachmentView which would become false when item is no longer in view
and based on that the component can run logic to (partially) reset itself

Let's first confirm whether we want to fix this at all
(BTW: If you switch to 2-3 images away and go back to the zoomed image it is not zoomed anymore)


✅ Ready for Review (pulled latest changes from main)

@thesahindia
Copy link
Member

Regarding the issue with resetting zoom

  • If we zoom an image and go to the next image then go back, the previous image remains in its zoomed-in position

I found out how to rest zoom for images, but not for PDF documents

I would prefer to address this in a separate PR as it would require a bit more changes and testing Like an isVisible prop added to the AttachmentView which would become false when item is no longer in view and based on that the component can run logic to (partially) reset itself

Let's first confirm whether we want to fix this at all (BTW: If you switch to 2-3 images away and go back to the zoomed image it is not zoomed anymore)

Since it's not anything major I am fine with doing nothing here, but let's confirm this with @johnmlee101.

@johnmlee101, can you please share your thoughts?

@thesahindia
Copy link
Member

When I increase the screen size I can see the image list and sometimes the image changes. @kidroca, can we fix this?

Screen.Recording.2023-04-15.at.7.51.05.PM.mov

Other than this it worked perfectly. I didn't face any other issue.


componentDidMount() {
this.makeStateWithReports();
this.state = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it's fine to overwrite the state. Can we use componentDidMount?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to componentDidMount

@johnmlee101
Copy link
Contributor

Let's first confirm whether we want to fix this at all

The zoom seems fine, I don't think it's much of a "bug" to have it retain the previous state of when you were viewing it

@kidroca
Copy link
Contributor Author

kidroca commented Apr 17, 2023

When I increase the screen size I can see the image list and sometimes the image changes. @kidroca, can we fix this?

I don't think there's anything easy to do about it - the app is laggy when it's resized like that
For a blink the window becomes wider, before that information is relayed to App state, so components like FlatList can't know they're showing more than they have to

@thesahindia
Copy link
Member

When I increase the screen size I can see the image list and sometimes the image changes. @kidroca, can we fix this?

I don't think there's anything easy to do about it - the app is laggy when it's resized like that For a blink the window becomes wider, before that information is relayed to App state, so components like FlatList can't know they're showing more than they have to

@johnmlee101, should we create a new GH for this?

@thesahindia
Copy link
Member

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-04-15.at.6.01.10.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-04-18.at.8.10.09.PM.mov
Mobile Web - Safari
Screen.Recording.2023-04-15.at.7.48.30.PM.mov
Desktop
Screen.Recording.2023-04-15.at.6.20.08.PM.mov
iOS
Screen.Recording.2023-04-15.at.7.08.18.PM.mov
Android
Screen.Recording.2023-04-18.at.8.14.55.PM.mov

Copy link
Member

@thesahindia thesahindia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well!

cc: @johnmlee101

Copy link
Contributor

@johnmlee101 johnmlee101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked very well! Thanks for this

@johnmlee101 johnmlee101 merged commit f599146 into Expensify:main Apr 18, 2023
@thesahindia
Copy link
Member

thesahindia commented Apr 18, 2023

When I increase the screen size I can see the image list and sometimes the image changes. @kidroca, can we fix this?

I don't think there's anything easy to do about it - the app is laggy when it's resized like that For a blink the window becomes wider, before that information is relayed to App state, so components like FlatList can't know they're showing more than they have to

@johnmlee101, should we create a new GH for this?

@johnmlee101, you missed this comment.

@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@johnmlee101
Copy link
Contributor

Ah I see. I think we can create a follow-up issue to see if others have more opinions about it. It does seem like a very tricky thing to implement so not sure if its worth changing. Screen size changes aren't a common occurrence for most users.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/johnmlee101 in version: 1.3.2-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@thesahindia
Copy link
Member

Ah I see. I think we can create a follow-up issue to see if others have more opinions about it.

Posted it here.

It does seem like a very tricky thing to implement so not sure if its worth changing. Screen size changes aren't a common occurrence for most users.

Agree! Let's see if there is any simple solution.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 1.3.2-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

* @returns {JSX.Element}
*/
renderCell(props) {
const style = [props.style, styles.h100, {width: this.state.containerWidth}];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

containerWidth is set after View onLayout callback so there's glitch when window size changes - #17760
To overcome this, we used windowWidth in #18615.

return (
<View
style={[styles.attachmentModalArrowsContainer]}
style={[styles.attachmentModalArrowsContainer, styles.flex1]}
onLayout={({nativeEvent}) => this.setState({containerWidth: nativeEvent.layout.width + 1})}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up!! This line caused a regression in #18222. On iOS, the left edge of the PDF is visible on the previous image due to a missing 1px border calculation . We ended up removing the borderWidth.

file={this.state.file}

{this.state.containerWidth > 0 && (
<FlatList
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming from #19484:
While introducing FlatList for carousel, it caused weird behavior when press Arrow Left/Right keys.
Because FlatList wants to scroll horizontally as default and it conflicts with main navigating feature of arrow keys.
To fix this, we prevented default (e.preventDefault()) so that FlatList auto scroll doesn't work.

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.

7 participants