-
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: popover without overlay changes #24515
fix: popover without overlay changes #24515
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] |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
horizontal: nativeEvent.pageX + CONST.MODAL.POPOVER_ANCHOR_SHIFT, | ||
vertical: nativeEvent.pageY - CONST.MODAL.POPOVER_ANCHOR_SHIFT, |
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.
Isn't there better way without changing position?
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.
Wasn't able to find any better way. Do you have a suggestion?
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.
Issue exported: #25582
So I think we can just revert this change and let contributors fix on that issue.
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.
Sure thing!
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.
is this a solution for https://expensify.slack.com/archives/C049HHMV9SM/p1691745427354299? if so this is not fixing the root cause, the hover effect will be lost when you move the mouse out, but it will stay initially right? please correct me if i am wrong.
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 Reverted!
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.
@getusha My understanding was that the hover effect was being lost because the pointer was inside the popover when it shifted. Thus I added a shift of 2px (which is considering a border of 1px for menu) which seemed to do the job.
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 you're right, that's what i thought initially, the fact that the hover wasn't lost the first time made me suspect that the issue isn't caused by that and it wasn't. additionally the hover should not be lost if the popover is active and mouseLeave triggers.
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
@@ -48,7 +48,10 @@ function PopoverContextProvider(props) { | |||
}, [closePopover]); | |||
|
|||
React.useEffect(() => { | |||
const listener = () => { | |||
const listener = (e) => { | |||
if (!activePopoverRef.current || !activePopoverRef.current.ref || !activePopoverRef.current.ref.current || activePopoverRef.current.ref.current.contains(e.target)) { |
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.
Oh my goodness i wish we allowed optional chaining 😅
✋ 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: 1.3.57-0 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.3.58-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.57-6 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.58-5 🚀
|
Details
This PR fixes the following issues:
#24256
https://expensify.slack.com/archives/C049HHMV9SM/p1691745427354299
https://expensify.slack.com/archives/C049HHMV9SM/p1691745372419819
Fixed Issues
$ #24256
PROPOSAL: #24256
Tests
Login and click on the
+
icon in the LHN.Press
CMD+K
and verify that the popover closes and search page opens.Open any chat and right click on any message.
Move the cursor to the left in the same row, and then right click again.
Verify that the row remains hovered.
Open any popover.
Right click inside the popover.
Verify that the native context menu opens up and the popover remains visible.
Offline tests
Same as test steps.
QA Steps
Same as test steps.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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-08-14.at.11.46.29.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-08-14.at.12.01.25.PM.mov
Mobile Web - Safari
Screen.Recording.2023-08-14.at.12.00.40.PM.mov
Desktop
Screen.Recording.2023-08-14.at.11.55.49.AM.mov
iOS
Screen.Recording.2023-08-14.at.12.05.43.PM.mov
Android
Screen.Recording.2023-08-14.at.12.14.12.PM.mov