-
Notifications
You must be signed in to change notification settings - Fork 31
add custom masthead #36
base: master
Are you sure you want to change the base?
Conversation
In verticalNav component Masterhead is passed like prop because should be inside the nav component, maybe you are missing classes by this |
@aljesusg either way should work (using the
exhibits the same behavior... |
My point was about classes in the patternfly documentation masthead is inside the nav generated by verticalNav, so maybe there is some class missing, about the version mobile maybe is a bug |
@priley86 Setting the |
@mturley - i think you are probably most familiar. Any ideas? |
@priley86 I am just now coming back around to this mention. I may have some time later this week to look at this. @jeff-phillips-18 is correct that |
@mturley Yes, I believe the navCollapsed is only for desktop mode. |
I can look at fixing this myself tomorrow, but it seems to be a case of badly named props that I ripped off from pf-ng variable names while I ported over the logic. Not great. |
the problem is that the hamburger menu should do something differently in mobile mode and desktop mode, with respect to the props you need to pass in stateless (controlled) mode. The stateful behavior built in should be a good guideline for how that works, i'll see if i can find a good snippet. |
Okay, @priley86 @aljesusg this is the method inside VerticalNav that is used when you click the hamburger menu in the default masthead. Overriding it causes this to no longer be run, which is perhaps a bug in the stateful mode of the nav. But to use it statelessly, we can just replicate this behavior out in the demo app:
So in short, when in mobile screen sizes, the |
As for the active page not being set properly, we need to set the |
hey @mturley - i appreciate this. It's helpful to understand the inner workings here. That being said, it seems like this might not be as easy to use out of the box as I thought (particularly with custom masthead). Since custom masthead is still important in many spots, I could see this being important for some consumers. Do you mind following up in an issue w/ PF React (or maybe an existing issue if one already exists)? Since this is PF3, it is obviously low priority, but I think it may help to have an issue so we know to look out for this in the future. I will just close the PR for now if that's OK and we can reference it later... |
Ok, @priley86 we can do that. Should we also fix this PR so that the masthead works in the demo app in the meantime? I'll open an issue for this today on pf-react and reference this PR either way. |
Not sure when I can get to this, but I created this issue to track it in pf-react: patternfly/patternfly-react#525 I plan to fix this PR soon by lifting all the state out and working around the bug in the stateful behavior of VerticalNav. |
I have a partial fix for this, but still having some trouble with it... My apologies @priley86 ! I'm headed on PTO for my wedding... this will have to wait. I might have a chance to look at it over the weekend. Most likely this will be fixed in early September :( |
@priley86 if you or someone else has time and can reproduce these issues in Storybook in patternfly-react, maybe we can get the upstream bugs fixed that way. |
So I had a free hour and I started debugging this.. The I'm more worried about the active state not updating. Changing the
I added a I should stop working on PTO. @priley86 , hope this helps. |
thanks! I pushed a simple fix in #43 . Please feel free to keep iterating on this as you have time! |
@priley86 I pushed a fix for the feedback on #43 in #45 :) and thanks for merging patternfly/patternfly-react#539. I'm back from PTO and I'll try to finish fixing this before I get too wrapped up in V2V again. |
@priley86 here is a fix for the remaining problem with the expand/collapse on mobile: mturley@53d87c9 If we merge #45, rebase this branch on master, and cherry-pick that commit, I think that should resolve all the issues here. |
thanks! will give this a go soon @mturley |
Getting closer here...
Still a couple problems:
expand / collapse seems to work on desktop, but when clicking the hamburger on mobile, I do not see expand working...
With the navbar collapsed, it seems like we are missing some classes and the icons are not updating after page route switches.

@jeff-phillips-18 any ideas?