Restricted allowed heading for popover slot #673
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #491
What
This PR restricts the allowed tags for popover component heading slot to heading tags. This is the last of components and slots needing tag restrictions.
Notes
Usually, I don't think it's great to have a default for heading since the appropriate heading level tends to be context-dependent. However, I think
Popover
might be a special case, similar to a modal dialog.Popover
appears temporarily on mousehover and doesn't fall within a normal page structure.There seems to be a lot of debate around what the most appropriate heading level for a modal dialog is but nothing prescriptive.
There's a comment in w3 aria-practices discussion:
I think we can think of
Popover
similarly where maybe it's more important to have consistency acrossPopover
. For now, I will leave the:h4
default though we may want to revisit this in the future. Additionally, in dotcom,Popover
is actually not accessible at all for keyboard-only users so that is a whole other can of worms we need to address...