-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: 26178 Context menu does not close after user goes to the previous page #27268
Conversation
@aimane-chnaif 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] |
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.
Missing case:
Screen.Recording.2023-09-13.at.9.31.41.PM.mov
@aimane-chnaif Thanks for pointing that out, I think reactionListPopover belongs to ReportActionsView, that why we can't use it in NavigationRoot, so I handle hide popover in ReportActionsView |
@@ -284,4 +296,4 @@ function arePropsEqual(oldProps, newProps) { | |||
|
|||
const MemoizedReportActionsView = React.memo(ReportActionsView, arePropsEqual); | |||
|
|||
export default compose(Performance.withRenderTrace({id: '<ReportActionsView> rendering'}), withWindowDimensions, withLocalize, withNetwork())(MemoizedReportActionsView); | |||
export default compose(Performance.withRenderTrace({id: '<ReportActionsView> rendering'}), withNavigationFocus, withWindowDimensions, withLocalize, withNetwork())(MemoizedReportActionsView); |
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.
There's already useIsFocused
hook.
@aimane-chnaif Thanks for pointing that out. I updated the PR |
please pull main |
@@ -132,6 +132,13 @@ function ReportActionsView(props) { | |||
} | |||
}, [props.report, didSubscribeToReportTypingEvents, reportID]); | |||
|
|||
useEffect(() => { | |||
if (!isFocused && context.reactionListRef && context.reactionListRef.current) { |
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.
I don't quite understand this condition.
You meant if (isFocused || !context.reactionListRef || !context.reactionListRef.current)
?
Also, make sure to re-test after your latest change.
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.
@tienifr bump
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.
@aimane-chnaif sorry for the delay. I want to hide the emoji popover when we switch to other chat, that means the current chat will be hidden -> isFocused is false.
We also need to make sure context.reactionListRef.current is defined before calling hideReactionList
I also tested this and there's no regression. Pls let me know if it's unclear
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 is early return condition. It should be fully reversed
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.
ah sorry @aimane-chnaif, I faced with the lint error about early return, so I accidentally moved context.reactionListRef.current.hideReactionList();
outside if block. Will update soon.
@aimane-chnaif updated. Can you help review again? Thanks |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
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 🎉
@youssef-lr Can you help take a look at this? 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/youssef-lr in version: 1.3.72-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.72-11 🚀
|
Details
Fixed Issues
$ #26178
PROPOSAL: #26178 (comment)
Tests
Offline tests
Same as above
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 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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Screen.Recording.2023-09-12.at.22.46.51.mov
Mobile Web - Chrome
Screenrecorder-2023-09-12-22-52-51-947.mp4
Mobile Web - Safari
Screen.Recording.2023-09-12.at.22.53.30.mov
Desktop
Screen.Recording.2023-09-12.at.23.04.39.mov
iOS
Screen.Recording.2023-09-12.at.23.13.13.mov
Android
Screen.Recording.2023-09-12.at.23.13.13.mov