Unverified Commit 6d5d578a authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

[dev-overlay] add aria to disabled docs button (#76055)

The tooltip from the `title` property was missing when the docs button
was disabled.

Closes NDX-798

---------
Co-authored-by: 's avatarSebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
parent 1afef128
......@@ -13,25 +13,14 @@ const meta: Meta<typeof CopyStackTraceButton> = {
export default meta
type Story = StoryObj<typeof CopyStackTraceButton>
const errorWithStack = new Error('Test error')
errorWithStack.stack = `Error: Test error
at Context.<anonymous> (test.ts:1:1)
at processImmediate (node:internal/timers:466:21)`
export const WithStackTrace: Story = {
args: {
error: errorWithStack,
error: new Error('Boom'),
},
}
export const WithoutStackTrace: Story = {
args: {
error: new Error('Error without stack'),
},
}
export const Disabled: Story = {
args: {
error: undefined,
error: Object.assign(new Error('Boom'), { stack: undefined }),
},
}
......@@ -21,7 +21,12 @@ export function DocsLinkButton({ errorMessage }: { errorMessage: string }) {
if (!docsURL) {
return (
<button className="docs-link-button" disabled>
<button
title="No related Next.js docs found"
aria-label="No related Next.js docs found"
className="docs-link-button"
disabled
>
<DocsIcon
className="error-overlay-toolbar-button-icon"
width={14}
......@@ -33,8 +38,8 @@ export function DocsLinkButton({ errorMessage }: { errorMessage: string }) {
return (
<a
title="Related Next.js Docs"
aria-label="Related Next.js Docs"
title="Go to related Next.js docs"
aria-label="Go to related Next.js docs"
className="docs-link-button"
href={docsURL}
target="_blank"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment