-
Notifications
You must be signed in to change notification settings - Fork 53
FAQ a11y sign off updates #358
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,8 +100,8 @@ export const AllClosed: StoryFn<typeof FAQ> = () => { | |
return ( | ||
<Container> | ||
<FAQ> | ||
<FAQ.Heading>Frequently asked questions</FAQ.Heading> | ||
<> | ||
<FAQ.Heading id="all-closed-faq">Frequently asked questions</FAQ.Heading> | ||
<FAQ.Group aria-labelledby="all-closed-faq"> | ||
{fixtureData.map(({question, answer}) => { | ||
return ( | ||
<FAQ.Item key={question} open={false}> | ||
|
@@ -110,7 +110,7 @@ export const AllClosed: StoryFn<typeof FAQ> = () => { | |
</FAQ.Item> | ||
) | ||
})} | ||
</> | ||
</FAQ.Group> | ||
</FAQ> | ||
</Container> | ||
) | ||
|
@@ -120,8 +120,8 @@ export const AllOpen: StoryFn<typeof FAQ> = () => { | |
return ( | ||
<Container> | ||
<FAQ> | ||
<FAQ.Heading>Frequently asked questions</FAQ.Heading> | ||
<> | ||
<FAQ.Heading id="all-open-faq">Frequently asked questions</FAQ.Heading> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we apply this inside the component using a unique id? I suspect users may forget to do this otherwise so we could do it for them internally There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would you feel about making these props required and leaving information in the documentation? We could do this dynamically but it would require a second loop of the children to first grab the id if a user specifies one and then set the id on the group. Of course, if they didn't supply one then this second loop wouldn't be needed but I was thinking we would want to support them passing their own id if they wanted to access that component using an id query. |
||
<FAQ.Group aria-labelledby="all-open-faq"> | ||
{fixtureData.map(({question, answer}) => { | ||
return ( | ||
<FAQ.Item key={question} open={true}> | ||
|
@@ -130,7 +130,7 @@ export const AllOpen: StoryFn<typeof FAQ> = () => { | |
</FAQ.Item> | ||
) | ||
})} | ||
</> | ||
</FAQ.Group> | ||
</FAQ> | ||
</Container> | ||
) | ||
|
@@ -145,8 +145,10 @@ export const HeadingLeftAligned: StoryFn<typeof FAQ> = () => { | |
return ( | ||
<Container> | ||
<FAQ> | ||
<FAQ.Heading align="start">Frequently asked questions</FAQ.Heading> | ||
<> | ||
<FAQ.Heading id="heading-left-aligned" align="start"> | ||
Frequently asked questions | ||
</FAQ.Heading> | ||
<FAQ.Group aria-labelledby="heading-left-aligned"> | ||
{fixtureData.map(({question, answer}) => { | ||
return ( | ||
<FAQ.Item key={question}> | ||
|
@@ -155,7 +157,7 @@ export const HeadingLeftAligned: StoryFn<typeof FAQ> = () => { | |
</FAQ.Item> | ||
) | ||
})} | ||
</> | ||
</FAQ.Group> | ||
</FAQ> | ||
</Container> | ||
) | ||
|
@@ -166,8 +168,8 @@ export const Groups: StoryFn<typeof FAQ> = () => { | |
<Container> | ||
<FAQ> | ||
<FAQ.Heading size="large">Frequently asked questions</FAQ.Heading> | ||
<FAQ.Subheading>Group heading</FAQ.Subheading> | ||
<> | ||
<FAQ.Subheading id="group">Group heading</FAQ.Subheading> | ||
<FAQ.Group aria-labelledby="group"> | ||
{fixtureData.map(({question, answer}) => { | ||
return ( | ||
<FAQ.Item key={question}> | ||
|
@@ -176,7 +178,7 @@ export const Groups: StoryFn<typeof FAQ> = () => { | |
</FAQ.Item> | ||
) | ||
})} | ||
</> | ||
</FAQ.Group> | ||
</FAQ> | ||
</Container> | ||
) | ||
|
@@ -291,15 +293,17 @@ export const DynamicDataExample: StoryFn<typeof FAQ> = () => { | |
return ( | ||
<Container> | ||
<FAQ> | ||
<FAQ.Heading>Frequently asked questions</FAQ.Heading> | ||
{faqs.map((item, index) => { | ||
return ( | ||
<FAQ.Item key={index}> | ||
<FAQ.Question>{item.title}</FAQ.Question> | ||
<FAQ.Answer>{item.content}</FAQ.Answer> | ||
</FAQ.Item> | ||
) | ||
})} | ||
<FAQ.Heading id="dynamic">Frequently asked questions</FAQ.Heading> | ||
<FAQ.Group aria-labelledby="dynamic"> | ||
{faqs.map((item, index) => { | ||
return ( | ||
<FAQ.Item key={index}> | ||
<FAQ.Question>{item.title}</FAQ.Question> | ||
<FAQ.Answer>{item.content}</FAQ.Answer> | ||
</FAQ.Item> | ||
) | ||
})} | ||
</FAQ.Group> | ||
</FAQ> | ||
</Container> | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needed to be removed to support this a11y issue