-
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
Fix - Web - Blue selection border on plan option after a refresh #54682
Fix - Web - Blue selection border on plan option after a refresh #54682
Conversation
@hoangzinh Please 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] |
I am having trouble building for android native. |
@FitseTLT there is a failed unit tests in your new tests |
@hoangzinh the problem was caused by the unit test importing always the native code; I proved that b/c the test passes if I delete the native file. So I fixed it by separating the implementation in a different file and importing it 👍 U can proceed. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-01-31.at.21.28.29.android.movAndroid: mWeb ChromeScreen.Recording.2025-01-31.at.21.29.37.android.chrome.moviOS: NativeScreen.Recording.2025-01-31.at.21.41.24.moviOS: mWeb SafariScreen.Recording.2025-01-31.at.21.30.51.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-01-31.at.21.23.57.web.movMacOS: DesktopScreen.Recording.2025-01-31.at.21.27.07.desktop.mov |
@FitseTLT it seems we haven't fixed this issue completely, when reload the page the blue selection border does not show but when I start to select options, it shows again Screen.Recording.2025-01-03.at.17.14.23.mov |
@hoangzinh Fixed U can proceed |
Bug 2: It doesn't sync focus in the first key down press. It only works from 2nd time Screen.Recording.2025-01-22.at.22.07.36.mov |
@hoangzinh Fixed |
The problem where the syncing didn't work on the first key press was caused because the key down event listener in useSyncFocus was called after the focus on the item was changed so syncing wasn't happening as the hasKeyBeenPressed ref will be false by the time the effect runs. So, now we activate the sycing immediately on focus change via arrow (useArrowKeyFocusManager) and also when other key presses happen (SelectionList). |
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.
Sorry for late review. It works for me. Just a few feedbacks
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.
LGTM
|
||
return () => removeKeyDownPressListener(setHasKeyBeenPressed); | ||
}, [setHasKeyBeenPressed]); | ||
|
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.
Same, some comments might help for whoever comes here in the future.
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.
@cristipaval I added a comment here
App/src/components/SelectionList/BaseSelectionList.tsx
Lines 328 to 330 in 1c9c6a7
// We need to track whether a key has been pressed to enable focus syncing only if a key has been pressed. | |
// This is to avoid the default behavior of web showing blue border on click of items after a page refresh. | |
hasKeyBeenPressed.current = true; |
Isn't that enough? Because here the name of the ref already gives a hint why it is being set on key down event. WDYT
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.
yes, I think that should be enough to know the reason for this code. Thanks
✋ 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/cristipaval in version: 9.0.95-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.95-6 🚀
|
Details
Fixed Issues
$ #54502
PROPOSAL: #54502 (comment)
Tests
Offline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label 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
Android: Native
Android: mWeb Chrome
aw.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
iw.mp4
MacOS: Chrome / Safari
w.mp4
MacOS: Desktop
d.mp4