-
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
Add popovers without overlay #19011
Add popovers without overlay #19011
Conversation
@dangrous @aimane-chnaif One of you needs to 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.
Is it really impossible to implement non-modal popover without introducing anchor ref or name constants?
src/CONST.js
Outdated
@@ -664,7 +665,6 @@ const CONST = { | |||
VALIDATE_CODE_FAILED: 'Validate code failed', | |||
}, | |||
}, | |||
|
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.
why line removed? unnecessary change
...modalStyle, | ||
...popoverAnchorPosition, | ||
...{ | ||
position: 'fixed', |
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.
you introduced new modal type just because of this?
what issue you have if position: 'absolute'
?
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.
With position:'absolute'
is for nearest relative
positioned element. We need it to be against the window
.
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.
Still not convinced about this change. I don't like introducing new popover style just because of this.
If absolute
, what regression occurs?
Why is it working in old popover?
Lint failing. Please pull main and fix all lint errors |
547164c
to
256bb31
Compare
@aimane-chnaif Lint is failing because of a warning that |
There's a discussion on that - https://expensify.slack.com/archives/C01GTK53T8Q/p1680256754764159
what's your answer? |
@aimane-chnaif I don't believe that anything is impossible. It's better to dive into the reason why we need these in the first place. We're using You might say that we can stop the propagation of event once it reaches the context. But in order to do so, we need to make sure that the click came from within the anchor element. So we will still need a ref of the anchor. However, with this, we wont be needing to add the anchor check to the individual anchor button callbacks. |
@narefyev91 Would love to hear your feedback here as well! |
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.
Alright, let's go for it! I'm going to merge.
I modified the QA steps for this particular issue to include the original "bug". They are still a bit light BUT I think that's fine because ideally we shouldn't really see any changed behavior, and if we do it'll be caught by QA.
Incredible job pushing this over the line, everyone! I really appreciate the time everyone put into it, this was definitely a long and intense project.
Looks like we need to update the checklist as well 😄 Doing that now. |
LOL @allroundexperts the checklist has changed since we made this PR. Do you mind pulling the new checklist from the template and copying it into the description, then filling it out? EDIT: nvm, I see you noticed first |
@dangrous Good to go! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
I keep looking for bugs on slack reported from our good testers so that we can fix them quickly as follow-up before being deploy blocker. |
@allroundexperts popover doesn't close on Esc key. Only happens on emoji picker Screen.Recording.2023-08-07.at.1.56.16.AM.mov |
@aimane-chnaif Fixed here |
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.51-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.52-0 🚀
|
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.52-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.52-5 🚀
|
I have a question about the implementation here. A long back we were able to open multiple context menus like those implemented here without the need for this new PopoverWithoutOverlay. IMO, we can disable the overlay with just a simple prop called |
@allroundexperts I would love to hear some thoughts on this as it is holding a PR. |
@parasharrajat Please refer to the discussion following this proposal. |
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.
Please keep the same name as class.
|
||
Popover.propTypes = propTypes; | ||
Popover.defaultProps = defaultProps; | ||
Popover.displayName = 'Popover'; |
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 should be PopoverWithoutOverlay. There is another Popover in the app.
close(props.anchorRef); | ||
} | ||
Modal.willAlertModalBecomeVisible(props.isVisible); | ||
Modal.setCloseModal(props.isVisible ? () => props.onClose(props.anchorRef) : null); |
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 #27244
There will be a chance of race condition when the new popover setCloseModal
will be overwritten by the previous popover, which isVisible
property is changed into false (about to be closed) and make one of the pop over stuck.
Details
This PR creates new popover that does not have an overlay. This mimics the behaviour of the popovers that are there on other popular websites such as gmail.
Fixed Issues
$ #15289
PROPOSAL: #15289 (comment)
Tests
Offline tests
N/A
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-05-16.at.5.58.21.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-05-16.at.6.03.00.PM.mov
Mobile Web - Safari
Screen.Recording.2023-05-16.at.6.05.39.PM.mov
Desktop
Screen.Recording.2023-05-16.at.5.59.15.PM_compressed.mp4
iOS
Screen.Recording.2023-05-16.at.6.04.43.PM.mov
Android
Screen.Recording.2023-05-16.at.6.04.11.PM.mov