fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Nav] Item Groups option to not expand on click

Open graham-sportsmgmt opened this issue 9 years ago • 24 comments

I have a Nav structure where I don't want my parent ItemGroups navigating to a new page or picking up the Active style as they are purely categories and I want the user selecting something under them to proceed. The current behavior (as of 1.7.0) is to only expand an Item Group when the accompanying arrow is clicked and the Active status is set to true on click.

I'd like to propose an option for the ItemGroup that puts it into a mode where:

  1. Clicking anywhere on the object area (i.e. arrow or label) will toggle the isExpanded status
  2. The Active flag will stay false

This would be in line with other Web UI frameworks such as Bootstrap or Foundation.

graham-sportsmgmt avatar Feb 13 '17 15:02 graham-sportsmgmt

Nav component actually support TRUE group header just for category and owning child links. Then each link can be level 1 (parent) link or level 2 (child) link.

Just in SP UX LeftNav, design choose not to show Group Header and only Level 1 and Level 2 links. My question to you is that you wish SP LeftNav can host level 1 "link" that only serve as heading not real link?

inateeg avatar Feb 15 '17 21:02 inateeg

Or you are talking about Nav component used elsewhere in general?

inateeg avatar Feb 15 '17 21:02 inateeg

INavLinkGroup currently is serve what you are asking just it is not used in our SP modern page LeftNav. That is why I am asking if you are asking for SP UX leftNav can support you with this heading or Nav component in general Level 1 link can be just header with no navigation on click?

inateeg avatar Feb 15 '17 21:02 inateeg

Yes, I'd like to have a group header to be only a header and not navigate. How does that work? I don't see anything in the documentation that addresses that.

I'm not sure what you're asking here though, could you please reword it?

I am asking if you are asking for SP UX leftNav can support you with this heading or Nav component in general Level 1 link can be just header with no navigation on click?

graham-sportsmgmt avatar Feb 15 '17 21:02 graham-sportsmgmt

INavLinkGroup is only header. Not a link.

inateeg avatar Feb 15 '17 21:02 inateeg

The documentation is really unclear on how this works. Could we add more detail to that page to explain this?

graham-sportsmgmt avatar Feb 15 '17 21:02 graham-sportsmgmt

OK I will try to update if you got to below link https://fabricreact.azurewebsites.net/fabric-react/master/#/examples/nav

Fabric sample page. The LeftNav here is organized under Group headers that seem what you are looking for?

inateeg avatar Feb 15 '17 21:02 inateeg

I get this error when I try to visit that link:

Sorry, but we’re having trouble signing you in. We received a bad request.

I am using Edge with an Azure AD account.

graham-sportsmgmt avatar Feb 15 '17 21:02 graham-sportsmgmt

Is there any way to see an example?

I'm using ES6 and not TypeScript btw. Is this only a TypeScript feature?

graham-sportsmgmt avatar Feb 16 '17 00:02 graham-sportsmgmt

https://dev.office.com/fabric#/components/nav

try this link?

inateeg avatar Feb 16 '17 05:02 inateeg

Yes, that link works. I didn't see any specific examples of what you were mentioning on that page.

Here is how I'm defining my groups, how can I change this to reflect a Group header without link?

let groups = [{
              links: [
                {
                  name: 'A',
                  icon: 'Stopwatch',
                  links: [{
                    name: 'A1',
                    key: 'key1'
                    },
                    {
                      name: 'A2',
                      key: 'key2'
                    }
                  ]
                },
                {
                  name: 'B',
                  icon: 'Edit',
                  links: [{
                    name: 'B1',
                    key: 'key1'
                    },
                    {
                      name: 'B2',
                      key: 'key2'
                    }
                  ]
                },
                {
                  name: 'C',
                  icon: 'People',
                  links: [{
                    name: 'C1',
                    key: 'key1'
                    },
                    {
                      name: 'C2',
                      key: 'key2'
                    }
                  ]
                }
              ]
            }];

graham-sportsmgmt avatar Feb 16 '17 05:02 graham-sportsmgmt

Try this out if you add a group name, it will render group header.

inateeg avatar Feb 16 '17 05:02 inateeg

Thank you, that changed the output to match the "Navigation menu used in this Fabric React demo app" example. However, I see four key formatting problems:

  1. The text is all caps which doesn't meet our UX guidelines,
  2. I can no longer display an icon next to the label,
  3. There is a lot of white space below the last item in a group, and
  4. Every item starts expanded and doesn't respond to the isExpanded property

The Office 365 Admin portal is what I'm trying to emulate. It is very intuitive, is nice and simple to use, and looks great too:

https://portal.office.com/adminportal/home#/homepage

graham-sportsmgmt avatar Feb 16 '17 05:02 graham-sportsmgmt

I am looping in David. We can adjust group header style since we did not get a lot feedback or you can override css style of group header. As for icon, I am not sure what you mean the link with icon?

inateeg avatar Feb 16 '17 06:02 inateeg

@graham-sportsmgmt I will talk with @inateeg . I believe i understand what you're saying. We'll either translate this into a codepen, or get a feature request going.

dzearing avatar Feb 16 '17 07:02 dzearing

Thanks, I think that the feature request could be as simple as giving us the ability to configure Nav to work exactly like the Office 365 Admin portal's left hand navigation.

graham-sportsmgmt avatar Feb 16 '17 14:02 graham-sportsmgmt

are you saying UI like this page?

https://portal.officeppe.com/account/#settings

inateeg avatar Feb 16 '17 18:02 inateeg

I don't see any attachments, although it looks like you did try to add one.

graham-sportsmgmt avatar Feb 16 '17 18:02 graham-sportsmgmt

https://portal.officeppe.com/account/#settings you meant this page? this one?

inateeg avatar Feb 17 '17 18:02 inateeg