Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/typescriptlang-org/src/templates/documentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const HandbookTemplate: React.FC<Props> = (props) => {
<section id="doc-layout" >
<SidebarToggleButton />

<div className="page-popup" id="page-helpful-popup" style={{ opacity: 0, display: "none" }}>
<div className="page-popup" id="page-helpful-popup" role="status" aria-live="polite" style={{ opacity: 0, display: "none" }}>
<p>Was this page helpful?</p>
<div>
<button className="first" id="like-button-popup" title="Like this page"><LikeUnfilledSVG /></button>
Expand Down Expand Up @@ -161,7 +161,7 @@ const HandbookTemplate: React.FC<Props> = (props) => {
<MarkdownHeadingTree tree={headerListToTree(sidebarHeaders)} className="handbook-on-this-page-section-list" slug={slug} />
</>
}
<div id="like-dislike-subnav">
<div id="like-dislike-subnav" role="status" aria-live="polite">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know about the redundancy, but should these only be added after the click has happened?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let me rephrase - if the whole thing is that we don't announce an update (e.g. "thanks for the feedback"), doesn't this mean on every docs page will announce the entire "is this page helpful?" control?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That won't happen here. aria-live="polite"> announces anything to the screen reader only if there are any dynamic changes made to the region's content. So unless a user click on the thumbs up or down button, "thanks for feedback" will not be announced, and "is this page helpful" is also not announced.

<h5>{i("handb_like_dislike_title")}</h5>
<div>
<button title="Like this page" id="like-button"><LikeUnfilledSVG /> {i("handb_like_desc")}</button>
Expand Down
Loading