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

add presentation role to root div #9828

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/server/Document/__snapshots__/component.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ exports[`Document Component should render AMP version correctly 1`] = `
>
<div
id="root"
role="presentation"
>
<h1
data-reactroot=""
Expand Down Expand Up @@ -146,6 +147,7 @@ exports[`Document Component should render correctly 1`] = `
<body>
<div
id="root"
role="presentation"
>
<h1
data-reactroot=""
Expand Down
6 changes: 5 additions & 1 deletion src/server/Document/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ const Document = ({
)}
</head>
<body {...ampGeoPendingAttrs}>
<div id="root" dangerouslySetInnerHTML={{ __html: html }} />
<div
id="root"
role="presentation"
Copy link

@greenc05 greenc05 Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a note/comment somewhere to say what this if for please?

dangerouslySetInnerHTML={{ __html: html }}
/>
{scriptsAllowed && (
<script
dangerouslySetInnerHTML={{
Expand Down