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

[feat] <rh-disclosure> #1293

Open
1 of 2 tasks
eyevana opened this issue Oct 23, 2023 · 4 comments · May be fixed by #2043
Open
1 of 2 tasks

[feat] <rh-disclosure> #1293

eyevana opened this issue Oct 23, 2023 · 4 comments · May be fixed by #2043
Assignees
Labels
for dev Ready for development new component New component to be created red hack day Good issue for Red Hack Day

Comments

@eyevana
Copy link
Collaborator

eyevana commented Oct 23, 2023

Description

The catalog has a need for an rh-disclosure element. It's currently classified as a pattern on ux.redhat.com, but after discussing in office hours, it's really an element.

image

Acceptance Criteria

  • Design done
  • Development done

Image

No response

Link to design doc

No response

Other resources

No response

@eyevana eyevana added the new component New component to be created label Oct 23, 2023
@bennypowers bennypowers changed the title [feat] rh-disclosure [feat] <rh-disclosure> Oct 31, 2023
@hellogreg hellogreg removed their assignment Nov 15, 2023
@coreyvickery coreyvickery added the for dev Ready for development label Jan 8, 2024
@hellogreg hellogreg removed their assignment Apr 18, 2024
@diwanshi diwanshi added the red hack day Good issue for Red Hack Day label Jun 10, 2024
@bennypowers
Copy link
Member

I think we can crib a bunch of implementation from uxdot-toc (which is basically disclosure at mobile widths) and docs from docs/patterns/disclosure

@hellogreg hellogreg moved this from Backlog to Todo in Red Hat Design System Oct 3, 2024
@markcaron
Copy link
Collaborator

For clarification / posterity, I want to make sure we're pursuing a strict disclosure UI and not conflating disclosure with an expandable section ("view more" on truncated content). IMO, that's a completely different pattern and component.

@markcaron markcaron self-assigned this Oct 31, 2024
@hellogreg
Copy link
Collaborator

hellogreg commented Nov 1, 2024

Just some quick notes if disclosure is going to wrap <details>...

Do not...

  • Don't add an explicit role to <summary>. This may be tempting, because different browsers assign different implicit roles to it (e.g., summary, button, pushbutton, disclosure triangle). But explicit roles actually break <summary> role and state announcements in Mac VoiceOver/Safari!
  • Don't add an aria-expanded attribute to <summary>. It's unnecessary and will not have any effect on the element. Instead, rely on the open attribute on the <details> element and let the browsers do their thing.

You can...(but)

  • Unlike with buttons, you can add headings within <summary>, according to the spec. But...
    • Be aware that, because some browsers and screen readers treat <summary> as a button, the heading's semantics may be squashed, at least a bit. All major screen readers will let you navigate via these headings, but they may not be read as headings.
    • Any headings within a <summary> will need a display: inline property, or you risk the disclosure triangle and heading winding up on different lines.

Consider...

  • Unlike most custom expandable/collapsable elements, pressing the esc key while focus is on <summary> will not collapse an open <details> element. You should be able to add this functionality with JS.
  • Be careful messing with the display: CSS property of <details>/<summary> — at least not without doing a ton of browser testing first. Trying to make one or the other a grid or flex has historically had undesirable results! (Update: looks like inline-block on <details> is pretty safe. Thanks, Adam and Steven!)

@adamjohnson adamjohnson self-assigned this Nov 7, 2024
@adamjohnson adamjohnson linked a pull request Nov 7, 2024 that will close this issue
3 tasks
@adamjohnson adamjohnson linked a pull request Nov 7, 2024 that will close this issue
3 tasks
@markcaron
Copy link
Collaborator

Similar to rh-footer's hiding content/links bug, I want to make sure that content elements are also built in ways that degrade gracefully.

We don't want to hide content if JS doesn't load properly.

With that—hopefully—rh-disclosure will fail open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for dev Ready for development new component New component to be created red hack day Good issue for Red Hack Day
Projects
Status: Todo
Status: Todo
Development

Successfully merging a pull request may close this issue.

8 participants