Add main as a wrapper for story content#2988
Conversation
…ut_doesnt_call_onFocusChange
…t_doesnt_call_onFocusChange
…ut_doesnt_call_onFocusChange
…ut_doesnt_call_onFocusChange
ktabors
left a comment
There was a problem hiding this comment.
Did you confirm that opening this in another tab via the button Danni mentioned did or didn't work for aXe and landmark?
Yes, i checked the "no main landmark" error is gone (see the second screenshot above) |
|
GET_BUILD |
|
Build successful! 🎉 |
LFDanLu
left a comment
There was a problem hiding this comment.
LGTM, will have to look at updating the landmark stories since there will be multiple main landmarks then but that is out of scope here IMO
| <main> | ||
| {storyReady && props.children} | ||
| </main> |
There was a problem hiding this comment.
Should main also wrap the div that precedes the story content?
There was a problem hiding this comment.
Hey Michael, thanks for reviewing! Yeah we can do that, but as long as we provide a main landmark the "no main landmark" error should be gone. The question is whether or not should we consider the "note" button as part of "main" content. 🤔
There was a problem hiding this comment.
I think it's fine for the note to be part of the main content. If not, axe might throw an error or warning when the note is present, because all content within the page is not contained within landmarks.
There was a problem hiding this comment.
I updated the PR. Thank!
Closes
#1268
This seems to be a real quick fix -- simply adding a
mainwrapper in.storybook/custom-addons/provider/index.jswould do the trick.Before:

After:

✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: