Skip to content

Commit c0bd7b6

Browse files
authored
fix: use h1 for title heading to improve accessibility (#10598)
Fixes #10480
1 parent 23e3e00 commit c0bd7b6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/core/components/info.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ class Info extends React.Component {
9797
return (
9898
<div className="info">
9999
<hgroup className="main">
100-
<h2 className="title">
100+
<h1 className="title">
101101
{title}
102102
<span>
103103
{version && <VersionStamp version={version} />}
104104
<OpenAPIVersion oasVersion="2.0" />
105105
</span>
106-
</h2>
106+
</h1>
107107
{host || basePath ? (
108108
<InfoBasePath host={host} basePath={basePath} />
109109
) : null}

src/core/plugins/oas31/components/info.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ const Info = ({ getComponent, specSelectors }) => {
3333
return (
3434
<div className="info">
3535
<hgroup className="main">
36-
<h2 className="title">
36+
<h1 className="title">
3737
{title}
3838
<span>
3939
{version && <VersionStamp version={version} />}
4040
<OpenAPIVersion oasVersion="3.1" />
4141
</span>
42-
</h2>
42+
</h1>
4343

4444
{(host || basePath) && <InfoBasePath host={host} basePath={basePath} />}
4545
{url && <InfoUrl getComponent={getComponent} url={url} />}

test/e2e-cypress/e2e/bugs/5138.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ describe("#5138: unwanted `url`/`urls` interactions", () => {
22
it("should stably render the first `urls` entry", () => {
33
cy
44
.visit("/pages/5138/")
5-
.get("h2.title")
5+
.get("h1.title")
66
.contains("USPTO Data Set API")
77
.wait(3000)
88
.contains("USPTO Data Set API")

test/e2e-cypress/e2e/features/urls.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("configuration options: `urls` and `urls.primaryName`", () => {
1919

2020
it("should render the first URL in the list", () => {
2121
cy.visit("/?configUrl=/configs/urls.yaml")
22-
.get("h2.title")
22+
.get("h1.title")
2323
.should("have.text", "OneOAS 2.0")
2424
.window()
2525
.then(win => win.ui.specSelectors.url())
@@ -31,7 +31,7 @@ describe("configuration options: `urls` and `urls.primaryName`", () => {
3131
cy.visit("/?configUrl=/configs/urls-primary-name.yaml")
3232
.get("select")
3333
.should("contain.value", "/documents/features/urls/2.yaml")
34-
.get("h2.title")
34+
.get("h1.title")
3535
.should("have.text", "TwoOAS 3.0")
3636
.window()
3737
.then(win => win.ui.specSelectors.url())

0 commit comments

Comments
 (0)