Fix holding on a message in search page scrolls the page#49970
Conversation
| ref={ref} | ||
| onScroll={onScroll ?? defaultOnScroll} | ||
| // Ignore the focus if it's caused by a touch event on a mobile chrome | ||
| shouldIgnoreFocus={Browser.isMobileChrome() && isScreenTouched} |
There was a problem hiding this comment.
So, I found that the long press callback is called later than the onFocus, so I changed the solution to ignore the focus whenever the touch event is detected. Luckily we already detect the touch event in this file, so I just need to pass down the shouldIgnoreFocus prop and ignore the focus if it's true.
There was a problem hiding this comment.
It might be more helpful later if the comment clearly mentions the quirk of Android Chrome triggering the onFocus event on long press.
|
There are some ESLint check failures. |
|
Fixed |
| onLongPressRow, | ||
| shouldShowTextInput = !!textInputLabel || !!textInputIconLeft, | ||
| shouldShowListEmptyContent = true, | ||
| shouldIgnoreFocus, |
There was a problem hiding this comment.
| shouldIgnoreFocus, | |
| shouldIgnoreFocus = false, |
NAB: Pleasing the linter with passing a default value here instead of double negating the possible undefined seems to be more inline with usual practices followed in our codebase.
Reviewer Checklist
Screenshots/VideosAndroid: NativescrollAndroid.mp4Android: mWeb ChromescrollAndroidmWeb.mp4iOS: NativescrolliOS.mp4iOS: mWeb SafariscrolliOSmWeb.mp4MacOS: Chrome / SafariscrollChrome.mp4MacOS: DesktopscrollDesktop.mp4 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.44-12 🚀
|
Details
When we hold down a list item, the item will receive the focus event and scrolls the list.
Fixed Issues
$ #49537
PROPOSAL: #49537 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4