-
Notifications
You must be signed in to change notification settings - Fork 377
feat(Popover): Add PF4 Popover #754
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
Conversation
Pull Request Test Coverage Report for Build 3328
💛 - Coveralls |
|
PatternFly-React preview: https://754-pr-patternfly-react-patternfly.surge.sh |
mcarrano
left a comment
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 looks good @boaz1337 But just a couple of comments:
- Clicking outside of the popover (as well as the Close button) should toggle it closed. See the PF3 React component. The behavior should be the same.
- The Header should not be a required element. I can envision cases where I would just want to place a message inside a popover without including a title or header.
|
Hi @boaz1337 , thanks for taking a stab at this. Few things, @mcarrano please correct me if I am wrong: Also from what I can tell in this example, the popover position is dependent on where it is in the DOM. The position prop sets the arrow in the right place, but the popover is not positioned correctly relative to an element (e.g. the button). Because of this we have suggested incorporating popper.js thidparty library in #487 to help with positioning. |
|
@jschuler Yes, you are correct. The popover is an element that floats on top of other content and is useful for things like displaying info tips on forms, etc. |
|
I updated the examples + changed the props as suggested. |
|
Deploy preview for patternfly-react-gone ready! Built with commit 2096d00 https://deploy-preview-754--patternfly-react-gone.netlify.com |
christiemolloy
left a comment
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.
Thanks for implementing the Popover @boaz1337 it looks great!! I have some comments for the CSS/UX review.
I believe we want to keep the content(text) inside of the popover component the same as the content that we have inside of pf-next to keep consistency. For example, swapping out "Popover title" to "Popover Header" and the same for the body.
I really like the option to change where the arrow should be positioned relative to the box. What is the plan for where the dropdown select will go? The user who implements the React component should change the arrow position within the code, not on the page. Otherwise the end user would also be able to change this. So I believe we wont need the dropdown implementation with the popover.
Are you planning to add implementation to the close button, enabling the user to exit out of the popover? That would be great to see :) I also wonder how the popover will pop up from text. @matthewcarleton I know you are looking at animation right now, would this be a good example where animation is needed?
The design for the headless popover looks like it has alignment issues. I will circle in a designer for a review on that so that we can make this a possibility. Again we would need to see this in PF-Next before we implement it in PF-React, but this is something we can do.
Circling in @mcarrano for a review on the Customized Popover (with arrow-less and no option to close button). What are your thoughts on this variations? Do they align with what we originally had as variations in the designs for the popover?
This looks great, let me know if you have any questions!
|
Per our discussion, let's remove the Customized Popover variations. We can add these later if a use case comes up that requires them. The Popover without Header requires some styling updates but we will do those in Core first and apply here. |
|
Hi @boaz1337! Are you interesting in continuing your work on this? |
|
Sorry that it took me too long - I will be working on this in the next days. |
|
Ok great! Thanks! |
|
@mcarrano & @christiemolloy can you PTAL. |
|
@boaz1337 This is looking better, but just a few comments:
|
|
Updated the Popover examples as you suggested. However, it seems like the problem with the headless popover comes from Thanks @mcarrano |
|
@boaz1337 Core merged PR https://github.com/patternfly/patternfly-next/pull #837 that refactored Popover. Could you update this PR to reflect those changes? |
|
It looks like I can't update to I think the problem is because on my machine Any thoughts? |
|
Hi @boaz1337 , every project that has |
|
Also, in order to have this be ready for consumers we need positioning engine (i.e. popper.js). But this is already great work here! I think we can either a) Merge this but not yet export the components out (in index.js), or b) Include positioning engine. |
|
Thanks @jschuler I rebased and updated I am not sure my Thanks. |
tlabaj
left a comment
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.
Can you update the examples so that they match the examples in PF-next.
|
I updated the examples to match to PF next. |
|
@christiemolloy yup! we definitely want to consider animation here. We are currently working out how we are going to tackle animation so it likely won't be ready for this PR but we will have this component on the list for future updates. |
tlabaj
left a comment
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.
Thanks @boaz1337, the example updates look good!
|
@boaz1337 this looks really good thanks for making changes! Will the Close button on the "headless" popover work? |
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
|
Hey @boaz1337 , I went ahead and merged from master and also removed the popover component from the export list. This way we can merge this code and not expose to the consumer. Once positioning work is ready we can add it back into the index.js files. |
|
@mcarrano @tlabaj Are you guys good with the changes? |
mcarrano
left a comment
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 approve this for now with the understanding that event handling will be integrated later via separate PR. The popover should dismiss whenever the user clicks outside of it as well as when clicking the Close button.
tlabaj
left a comment
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
|
Thank you so much! |
closes #487