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
fix: Layout.Header accessibility role #43749
Conversation
Run & review this pull request in StackBlitz Codeflow. |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #43749 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 658 658
Lines 11089 11110 +21
Branches 3000 3006 +6
=========================================
+ Hits 11089 11110 +21
☔ View full report in Codecov by Sentry. |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
Close #43718
💡 Background and solution
For html
<header />
elements to be treated as landmark elements, they cannot be placed within a<section />
element.Layout
outputs a<section />
which stripsLayout.Header
of itsbanner
role. To fix this,Layout
can simply output a<div />
instead.📝 Changelog
Layout.Header
accessibility role☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 5e42e5a
Change
Layout
component to usediv
instead ofsection
. This enhances the component's semantics and compatibility.🔍 Walkthrough
🤖 Generated by Copilot at 5e42e5a
tagName
property of theGeneratorProps
andBasicPropsWithTagName
interfaces from'section'
to'div'
to allow theLayout
component to use adiv
element as the root node (link, link)React.forwardRef
function fromHTMLElement
toHTMLDivElement
to match the type of theref
argument passed to theBasic
component incomponents/layout/layout.tsx
(link, link)tagName
property of thegenerator
function call from'section'
to'div'
to match the change in theGeneratorProps
interface and theBasicLayout
component incomponents/layout/layout.tsx
(link)