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

Descriptionlist in drawer demo #10229

Closed

Conversation

ajaypratap003
Copy link
Member

What: Closes #10227
Descriptionlist in drawer demo

Additional issues:

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 1, 2024

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.

Couple more comments below, otherwise we would just need input on my previous comments above from design/core

Comment on lines 37 to 43
const onCloseClick = () => {
setIsExpanded(false);
};

const onOpenDrawer = () => {
setIsExpanded(true);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

In addition to opening/closing the drawer, we should set focus on the appropriate element.

  • For the Drawer onExpand, the close button of the Drawer should receive focus, similar to our basic drawer example
  • When the Drawer gets closed, focus should be set back on the element that previously had focus before the Drawer was expanded. In this case it's easier since there's only the one button controlling expansion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you please help me on first point, is there any props in drawer component for setting focus on close button. In basic drawer example, I can't see the focus on close button.

Second point I've covered.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah so in that example I linked we're focusing the content of the drawer rather than the close button. We should actually do a similar thing here since the close button comes after the content in the DOM. We can just add a ref similar to that basic drawer example.

We'll also want to move the logic you currently have on the "Open drawer" button, tabIndex={isExpanded ? 0 : -1} to the drawer content title.

set focus back on button after closing drawer
Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM! One typo and an outstanding question about whether we should include tabs or not.

@ajaypratap003 ajaypratap003 requested a review from mcoker April 24, 2024 14:00
@mmenestr
Copy link
Collaborator

mmenestr commented Apr 25, 2024

Sorry I missed your previous comment @thatblindgeye - it's true that a selectable/deselectable card would be a more accurate way to show a drawer interaction via a card view, rather than just having link in a card. But I think since this demo is for the purpose of showing a description list in a drawer, the interaction is fine as is!

If you have extra time on your hands though, I would change it to a clickable card interaction because people get confused when we show different interactions in different places and don't know which one is "correct". And it could just be a single card, doesn't need to be a full page of clickable cards...

Will let you guys make the call though! Everything in the drawer looks good though!!

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.

This is looking good! We'd probably want to open an issue to update the core demo to match this if this is what we want it to look like (cc @mcoker ).

Can you try force pushing to this PR? For some reason the PR is building oddly in that it's building a drawer based on the latest update and as though we're still creating a Drawer component inside the demo. Pulling the PR locally everything seems fine, though.

@ajaypratap003
Copy link
Member Author

This is looking good! We'd probably want to open an issue to update the core demo to match this if this is what we want it to look like (cc @mcoker ).

Can you try force pushing to this PR? For some reason the PR is building oddly in that it's building a drawer based on the latest update and as though we're still creating a Drawer component inside the demo. Pulling the PR locally everything seems fine, though.

I tried force push but nothing happened. Any idea, why a11y job is failing

@nicolethoen
Copy link
Contributor

nicolethoen commented May 8, 2024

The a11y tests are failing on this PR: https://patternfly-react-pr-10229-a11y.surge.sh/

because there is a rendered DrawerPanel in a DrawerPanel which both have the id="pf-drawer-panel-0"

Screenshot 2024-05-08 at 1 02 03 PM

This is happening because you are passing a Drawer component via the DashboardWrapper's notificationDrawer prop. But I think it's expecting you to pass the contents of a drawer to the notificationDrawer prop rather than build one yourself.
I think i'd recommend you don't use the notificationDrawer prop but instead, wrap the Page in your Drawer instead?

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

Nice! Looks like some extra elements are being added

Screenshot 2024-05-08 at 1 45 13 PM

I see @nicolethoen was already on it 😆 !

Copy link

github-actions bot commented Jul 8, 2024

This PR has been automatically marked as stale because it has not had recent activity.

Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@thatblindgeye
Copy link
Contributor

Closing in favor of #11404 which targets our main v6 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Description list in Drawer demo
9 participants