| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
PatternFly-React preview: https://patternfly-react-pr-2861.surge.sh |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you so much for this PR! It's a great start, we just have to remove the isExpanded from state and some variable renames and we are good to go!
Sorry, something went wrong.
| } | ||
|
|
||
| componentDidMount() { | ||
| window.addEventListener('resize', this.closeExpandableContent); |
There was a problem hiding this comment.
Please do not listen on resize events and close expandable content. This is css breakpoints work, no need to close the content on each window resize. It adds performance issues and plus unwanted behavior.
Sorry, something went wrong.
There was a problem hiding this comment.
@karelhala There's an issue where if the toggle drawer is open and the window is resized when the breakpoint is hit the content will not layout correctly. We're looking for a solution to make it behave the same way that dropdown does. Will look at that code to see how that one works to see if there's a better solution.
Sorry, something went wrong.
There was a problem hiding this comment.
This is really unaesthetic because imagine that you are looking at table with this on mobile, click on the expand button, realise that landscape view might be better for this and once you flip the phone this expanded menu is lost and user has to click on it once again.
If the layout is not rendered correctly on window resize I think that is more of a issue in PF core and we shouldn't try to fix it here.
Sorry, something went wrong.
There was a problem hiding this comment.
@mcarrano Any thoughts on the behavior with the toggle?
Sorry, something went wrong.
There was a problem hiding this comment.
This is a tough one to answer because it's not clear what the best approach is. I agree that just collapsing the drawer on resize it not great. Maybe if the drawer is open and a breakpoint is crossed, the content should not reconfigure itself (i.e. suppress the behavior in this case). Is that even possible? @mattnolting any thoughts here?
Sorry, something went wrong.
There was a problem hiding this comment.
@mcarrano - matt nolting is on PTO until Tuesday.
regarding that being possible, yes I believe it is, but we'd have to use the breakpoint passed in by the user and look up the global size of that breakpoint and make it reconfigure itself based on the global size (hopefully no one will have over written it). I may not have time to figure that out today - but I can try. Would that be an acceptable approach @dlabaj?
Sorry, something went wrong.
There was a problem hiding this comment.
@mcarrano I think, when using a toggle group, the content should reconfigure at the specified breakpoint if expanded content is .pf-m-expanded.
Sorry, something went wrong.
There was a problem hiding this comment.
Well done @nicolethoen!!! It's really exciting to see all the great work you've done in action. Left some comments.
Sorry, something went wrong.
There was a problem hiding this comment.
Awesome work @nicolethoen !
Sorry, something went wrong.
| {toggleIcon} | ||
| </Button> | ||
| </div> | ||
| { isExpanded ? ReactDOM.createPortal(children, expandableContentRef.current): children } |
There was a problem hiding this comment.
I'm so glad this worked! For a while there I thought there might not be a declarative way to achieve this... but context, refs and portals = magic ✨
Sorry, something went wrong.
There was a problem hiding this comment.
Noticed a few non-blocking things, but this looks good to me.
Sorry, something went wrong.
| </Select> | ||
| </DataToolbarItem> | ||
| <DataToolbarItem> | ||
| <Select |
There was a problem hiding this comment.
There's some inconsistent indentation/spacing here and elsewhere in this file, but I don't think we need to hold up the PR for it. I'll address cases like this when I rebase #2810 after the release, but I'm not sure if Prettier will run on the JSX in our Markdown files, so that's something else I want to look into.
Sorry, something went wrong.
| variant="plain" | ||
| onClick={toggleIsExpanded} | ||
| {...isExpanded && { 'aria-expanded': true }} | ||
| // TODO aria-haspopup when isExpanded = true && viewport is smaller than lg global breakpoint |
There was a problem hiding this comment.
Is this something we need to implement with this PR, and if not can we open an issue to track it?
Sorry, something went wrong.
There was a problem hiding this comment.
good thought
Sorry, something went wrong.
There was a problem hiding this comment.
Let's open an issue for this.
Sorry, something went wrong.
There was a problem hiding this comment.
Issue created
Sorry, something went wrong.
There was a problem hiding this comment.
@nicolethoen Again, great work! Can we add an example of .pf-m-space-items on a group to the Data toolbar spacers example? Perhaps the last two action buttons?
@nicolethoen can we add a horizontal divider to the Data toolbar group stacked example?
@mcarrano @mceledonia should we add a horizontal divider to the Data toolbar group stacked example?
Sorry, something went wrong.
Yes and Yes! |
Sorry, something went wrong.
|
@nicolethoen This is looking great. Agree with adding the horizontal divider to the stacked example. The only other thing I found is that for the Consumer managed toggle group example, I can get into a situation where the drawer remains open but the toggle disappears by opening the drawer and then stretching the window. See below. If this is not easy to fix. I'd be OK to approve this and come back to address this as a bug in the next release. |
Sorry, something went wrong.
|
@mcarrano that's exactly what is discussed in #2861 (comment) Consumers should be rensponsible when the pane is hidden and shown in this example. So if you open this toggle change the screen size and want to close the pane consumer is responsible for that. It's actually expected bahavior. |
Sorry, something went wrong.
I noted this issue in the documentation above the example. |
Sorry, something went wrong.
There was a problem hiding this comment.
A few comments but looks good otherwise.
Sorry, something went wrong.
| className?: string; | ||
| /** Content to be rendered as rows in the Data toolbar */ | ||
| children?: React.ReactNode; | ||
| /** Flag indicating if a Data toolbar toggle group's expandable content is expanded */ |
There was a problem hiding this comment.
We should add a comment that setting this means that the consumer will be responsible for managing the toogle group expansion. Also how would a consumer find out if the toogle group is currently expanded after construction??? Can we use a getter to return the correct value.
Sorry, something went wrong.
There was a problem hiding this comment.
If the consumer is managing the expansion, they would already know, right? If the consumer is not managing the expansion, why do they need to be able to find out if it's currently expanded?
Sorry, something went wrong.
There was a problem hiding this comment.
There is some documentation just before the toggle group examples that i believe explains this? should I add more info to that documentation?
Sorry, something went wrong.
| variant="plain" | ||
| onClick={toggleIsExpanded} | ||
| {...isExpanded && { 'aria-expanded': true }} | ||
| // TODO aria-haspopup when isExpanded = true && viewport is smaller than lg global breakpoint |
There was a problem hiding this comment.
Let's open an issue for this.
Sorry, something went wrong.
There was a problem hiding this comment.
Looks great @nicolethoen !
Sorry, something went wrong.
There was a problem hiding this comment.
Just two more comments 😄
Sorry, something went wrong.
| <DataToolbarItem spacers={fifthSpacers}><Button variant="secondary">Action</Button></DataToolbarItem> | ||
| <DataToolbarItem><Button variant="primary">Action</Button></DataToolbarItem> | ||
| <DataToolbarItem variant="separator"></DataToolbarItem> | ||
| <DataToolbarGroup itemSpacers={[{spacerSize: 'lg'}]} spacers={[{spacerSize: 'lg'}]}> |
There was a problem hiding this comment.
Can you remove spacers={[{spacerSize: 'lg'}]}
Sorry, something went wrong.
| <DataToolbarItem variant="separator"></DataToolbarItem> | ||
| <DataToolbarGroup itemSpacers={[{spacerSize: 'lg'}]} spacers={[{spacerSize: 'lg'}]}> | ||
| <DataToolbarItem><Button variant="secondary">Action</Button></DataToolbarItem> | ||
| ` <DataToolbarItem><Button variant="secondary">Action</Button></DataToolbarItem> |
There was a problem hiding this comment.
looks like you have a floating tick mark ^^
Sorry, something went wrong.
There was a problem hiding this comment.
I love it!! 🎉 LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM!
Sorry, something went wrong.
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
#2009