Skip to content
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

docs(JumpLinks): add jump links with drawer demo #7520

Merged
merged 9 commits into from
Jun 16, 2022

Conversation

wise-king-sullyman
Copy link
Contributor

@wise-king-sullyman wise-king-sullyman commented Jun 6, 2022

What: Closes #6582

Additional issues:

One item on this that I'm not sure about: I didn't see how the drawer was to be toggled in the core demo. I took a similar approach to the switch used to demonstrate vertical vs horizontal capabilities in the other JumpLinks demo, but am more than happy to change it.

Convenience link to the jump links demos page: https://patternfly-react-pr-7520.surge.sh/components/jump-links/react-demos

And the new demo itself: https://patternfly-react-pr-7520.surge.sh/components/jump-links/react-demos/with-drawer/

@patternfly-build
Copy link
Contributor

patternfly-build commented Jun 6, 2022

Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity - maybe double the length of the gibberish text in each jump links section? At my default window width, there is no need to use jumplinks/no scrolling.


### With drawer

This demo shows how jump links can be used in combination with a drawer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also call out what you used as the scrollableSelector in this case? Just for clarity since I believe that was the major question which lead to the development of these demos

Copy link
Contributor

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good @wise-king-sullyman! Just one comment.

Co-authored-by: Jenny <32821331+jenny-s51@users.noreply.github.com>
Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @wise-king-sullyman . If it's not too much trouble, can the toggle be placed in a sticky page section so it always stays at the top when the content scrolls?

@jgiardino @srambach looks like the original request for this came from you. Is this what you were hoping to see?

@wise-king-sullyman
Copy link
Contributor Author

@mcarrano does this implementation of your sticky page section suggestion look good to you? The default variant looked a bit out of place to me so I went with the light variant, but I'm happy to change it.

@mcarrano
Copy link
Member

mcarrano commented Jun 9, 2022

Looks good to me. Thanks for adding that @wise-king-sullyman .


This demo shows how jump links can be used in combination with a drawer.

The scrollable selector passed to the jump links component is an id that was placed on the drawer content component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may even be incrementally more helpful if you use the markdown tics to emphasize the prop and component names in these instructions.

Maybe:
'The scrollableSelector prop passed to the jump links component should reference an id that was placed on the DrawerContent component.'

@srambach
Copy link
Member

This looks great; definitely showing what I had hoped, how to put both a drawer and jumplinks together in a page. I did notice though that the Skip to Content link doesn't go anywhere - I'd expect it to jump me to the main content. What do you think?

@wise-king-sullyman
Copy link
Contributor Author

@srambach it seems like VO is flaky on the skip to content in this demo for me for some reason. Sometimes it doesn't go anywhere, sometimes it accurately jumps to main, and sometimes it jumps to the jump links container and I can't figure out why.

If you/anyone have any ideas about why that is I am all ears.

@srambach
Copy link
Member

@srambach it seems like VO is flaky on the skip to content in this demo for me for some reason. Sometimes it doesn't go anywhere, sometimes it accurately jumps to main, and sometimes it jumps to the jump links container and I can't figure out why.

Hmm - I wasn't even trying VO, I was just using the tab key.

@wise-king-sullyman
Copy link
Contributor Author

Ah, using tab it seems like the page jumps back to the top but focus does seem to stay on the masthead. This seems to be the case in the other jump links demo and some other demos (the primary detail demos as an example) as well from some quick testing.

I wonder if this might be a bug with the dashboard wrapper.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! In terms of the skip link issue mentioned, the behavior I'm seeing I believe matches @wise-king-sullyman where focus looks to remain in the masthead/on the skip link button after clicking it.

Otherwise the skip link does work for me, albeit it's difficult to tell since the main content doesn't have a very large scroll (if I scroll in the content area with the "First section" etc headings, the main element scrolls a little and then clicking the skip link jumps the page back up the tiny bit).

@nicolethoen
Copy link
Contributor

I wonder if this might be a bug with the dashboard wrapper.

If you want to create an issue, that can be something we look at in the future.

<DashboardWrapper breadcrumb={null} mainContainerId="scrollable-element">
<Drawer isExpanded={isExpanded}>
<DrawerContent panelContent={panelContent} id="jump-links-drawer-drawer-scrollable-container">
<DrawerContentBody>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML demo also has this issue:

HTML jump links demo DOM

Would HTML need to be updated to fix that, or since this React demo aligns with HTML would it be fine leaving it as-is?

Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@srambach
Copy link
Member

Note that if you use the Skip to Content link, the jumplinks stop working. If you think this is because of the bug with Skip to Content noted above, then I guess that issue should be updated; otherwise it would be a new one.

@thatblindgeye
Copy link
Contributor

@srambach Created #7561 as a followup to that behavior.

@nicolethoen nicolethoen merged commit dce9976 into patternfly:main Jun 16, 2022
@wise-king-sullyman wise-king-sullyman deleted the jumplinks-drawer-demo branch June 16, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JumpLinks or Drawer?: build demo for a page with jumplinks and a drawer
9 participants