-
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
Sync keyboard navigation in SelectionList and PopoverMenu #39201
Sync keyboard navigation in SelectionList and PopoverMenu #39201
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeCleanShot.2024-04-02.at.23.22.15.mp4Android: mWeb ChromeCleanShot.2024-04-02.at.23.21.21.mp4CleanShot.2024-04-03.at.21.46.57.mp4iOS: NativeCleanShot.2024-04-02.at.02.49.27.mp4CleanShot.2024-04-02.at.20.08.49.mp4iOS: mWeb SafariCleanShot.2024-04-01.at.23.43.55.mp4MacOS: Chrome / SafariCleanShot.2024-04-01.at.23.34.53.mp4MacOS: DesktopCleanShot.2024-04-02.at.04.41.21.mp4 |
@WojtekBoman Could you please merge main ? Bug: PopoverMenu inside report screens still have the same bug
Screen.Recording.2024-04-01.at.11.38.42.PM.movCrash: App crash on ios When I open currency selector inside the request money flow
CleanShot.2024-04-02.at.02.48.42.mp4
This is not working on mobile (chrome and safari) Video
CleanShot.2024-04-01.at.23.44.29.mp4CleanShot.2024-04-02.at.04.32.36.mp4 |
@WojtekBoman The crash was fixed on IOS. However, the bug still persists in the Video 1CleanShot.2024-04-02.at.23.37.15.mp4Video 2CleanShot.2024-04-02.at.23.23.52.mp4Video 3CleanShot.2024-04-02.at.23.14.08.mp4 |
I'm still investigating this bug that appears on mobile browsers, I'll let you know when it's ready to check :) |
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.
Review after fixing the focus bug.
LGTM 👍 good job
@@ -14,7 +15,8 @@ function Hoverable({isDisabled, ...props}: HoverableProps, ref: Ref<HTMLElement> | |||
// If Hoverable is disabled, just render the child without additional logic or event listeners. | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
if (isDisabled || !hasHoverSupport()) { | |||
return cloneElement(getReturnValue(props.children, false), {ref}); | |||
const child = getReturnValue(props.children, false); | |||
return cloneElement(child, {ref: mergeRefs(ref, child.ref)}); |
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.
great find 👍
@fedirjh I believe that now it should work, but I'm not sure about bugs on |
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.
Looks good to me.
We merged this to fix some bugs with the key arrow functionality, since this is a considerable refactor of similar logic, please make sure the bug doesn't show up here. |
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.
Looking good from a design perspective! This is a great update. #not-an-engineer
conflicts |
3f4072c
Yes, I'll take a look at it. I'll let you know when it's ready :) |
@fedirjh Perf-tests have been fixed :) |
✋ 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/roryabraham in version: 1.4.63-0 🚀
|
Possible regression from here, can @WojtekBoman and @fedirjh , 👀 plz. |
Another possible regression: #40410 |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|
scrollToIndex(index, true); | ||
}, | ||
isFocused, | ||
}); |
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.
When we are using the useArrowKeyFocusManager
here, we should have passed the disabledIndexes
props, which caused this issue: #40583
@@ -64,6 +73,7 @@ function BaseListItem<TItem extends ListItem>({ | |||
onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined} | |||
nativeID={keyForList ?? ''} | |||
style={pressableStyle} | |||
onFocus={onFocus} |
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.
Coming from this issue #41922, we have added the onFocus to BaseListItem in this PR. We already had the onMouseDown conditional prop passed, so the bug might have been there with the conditional onMouseDown prop but became visible after the onFocus change. When we long press the currency in CurrencySelection, it triggers the onFocus function, and we see a scroll to the long-pressed index. We have fixed this by removing the conditional onMouseDown in BaseListItem.
Details
This PR fixes focusing on SelectionList and PopoverMenu items when navigating with tab button and arrows. Previously, these buttons worked independently, now only one item on the list is focused when navigating using them.
How it works without a fix:
Screen.Recording.2024-03-29.at.10.36.13.mov
Fixed Issues
$ #36476 (comment)
PROPOSAL: N/A
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2024-03-29.at.09.59.26.mov
MacOS: Desktop
Screen.Recording.2024-03-29.at.09.50.19.mov