[Bug]: AppLayout mobile navigation renders unsupported aria-orientation on nav
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- playwright, react, typescript
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
Bắt đầu với src/app-layout/visual-refresh/mobile-toolbar.tsx, dòng 56–59, nơi issue xác định thuộc tính không được hỗ trợ trên điều hướng di động. Kiểm tra các bài kiểm thử AppLayout hiện có cho điều hướng di động và bổ sung kiểm thử cho trạng thái đóng. Hoàn tất khi quá trình quét khả năng truy cập nghiêm ngặt đạt yêu cầu mà không loại bỏ tên trợ năng, ngữ nghĩa điều hướng hoặc hành vi chuyển đổi và lấy tiêu điểm.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Browser
Chrome / Chromium 149.0.7827.55 (Playwright).
Package version
3.0.1401 and 3.0.1310.
React version
19.2.7.
Description
When the standard AppLayout is rendered at a mobile viewport with navigation closed, its SDK-owned mobile navigation nav receives aria-orientation="horizontal". The element retains the implicit navigation role, which does not support this attribute. Strict axe scans report aria-allowed-attr.
Reproduced on both @cloudscape-design/components 3.0.1310 and 3.0.1401. Version 3.0.1401 was the npm latest version checked on 2026-10-16. The standalone reproduction uses no application wrappers or product theme, and does not alter Cloudscape DOM or CSS.
Actual behavior
The visible closed-state mobile toolbar renders the following markup (generated class names omitted):
<nav aria-hidden="false" aria-label="Navigation" aria-orientation="horizontal">
<!-- SDK navigation toggle -->
</nav>
axe-core 4.12.1 reports aria-allowed-attr, with impact classified as critical and the message ARIA attribute is not allowed: aria-orientation="horizontal".
Expected behavior
The navigation landmark uses supported ARIA attributes. Please correct the SDK-owned markup while retaining its accessible name, navigation semantics, and toggle/focus behavior. If orientation belongs to a toolbar widget, it should be applied to a semantically appropriate element.
Verified matrix
| Scenario | SDK 3.0.1310 | SDK 3.0.1401 |
|---|---|---|
| AppLayout, 390×844, navigation closed | aria-allowed-attr (one node) |
aria-allowed-attr (one node) |
| AppLayout, 390×844, navigation open | No WCAG violations | No WCAG violations |
| AppLayout, 1280×900, navigation closed | No WCAG violations | No WCAG violations |
| AppLayoutToolbar, 390×844, navigation closed | No WCAG violations | No WCAG violations |
The affected component is standard AppLayout; AppLayoutToolbar is included only as a diagnostic control. This report does not concern the legacy Classic visual theme.
Environment and impact
- Chromium 149.0.7827.55 via Playwright 1.61.1; Windows; Node.js v24.19.0.
- React/React DOM 19.2.7; Cloudscape global styles 1.0.60; axe-core 4.12.1.
- Strict scans use WCAG 2 A, WCAG 2 AA, and WCAG 2.1 AA tags, with no disabled rules or node exclusions.
- The invalid attribute causes automated accessibility gates to fail for standard mobile AppLayout consumers. Screen-reader behavior has not been assessed in this reproduction.
Source and references
- The matching markup is present in mobile-toolbar.tsx, lines 56–59, inspected on 2026-10-16. This identifies matching markup, not the commit that introduced the defect.
- WAI-ARIA navigation role and aria-orientation.
Acceptance check
The strict reproduction below should exit 0 after a fix, with all four scenarios passing and without suppressing aria-allowed-attr. Mobile navigation should still open and close with the same accessible controls.
Source code
The minimal failing component is:
import React from "react";
import { createRoot } from "react-dom/client";
import AppLayout from "@cloudscape-design/components/app-layout";
import "@cloudscape-design/global-styles/index.css";
createRoot(document.getElementById("root")).render(
<AppLayout
navigation={<a href="#content">Example section</a>}
navigationOpen={false}
toolsHide
ariaLabels={{
navigation: "Navigation",
navigationToggle: "Open navigation",
navigationClose: "Close navigation",
}}
content={<h1 id="content">Minimal AppLayout reproduction</h1>}
/>
);
The standalone project adds controlled navigation state and the Toolbar control so all matrix cases can run from the same fixture. The full standalone source and direct dependency pins are included below.
Reproduction
- Save the four source files below in a new standalone directory, install the pinned direct dependencies and Playwright Chromium, then build it.
- Run
pnpm test. It starts and stops its own local server, scans four scenarios, and writesevidence/report.jsonplus PNGs. - With affected versions, the expected exit code is 1: only
app-layout-mobile-closedfailsaria-allowed-attr. - For manual inspection, run
pnpm dev, openhttp://127.0.0.1:5295/, set the viewport to 390×844, and keep navigation closed. - Inspect the mobile navigation toggle parent
navand run axe. Open navigation or use the desktop viewport to compare.?layout=toolbaris the control.
corepack pnpm install --ignore-workspace
corepack pnpm exec playwright install chromium
corepack pnpm build
corepack pnpm test
The default standalone project pins SDK 3.0.1401. To rerun the baseline, change only the SDK version to 3.0.1310, regenerate the lockfile, and rerun. Both captured JSON reports are included below. The script generates fresh screenshots and a report locally.
Standalone reproduction files
Use Node.js 24 and pnpm 9.15.0. All direct dependencies are pinned; pnpm install generates the lockfile. No workspace packages are required.
package.json
{
"name": "cloudscape-app-layout-mobile-aria-repro",
"version": "1.0.0",
"private": true,
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"dev": "vite --host 127.0.0.1 --port 5295",
"build": "vite build",
"test": "node capture.mjs"
},
"dependencies": {
"@cloudscape-design/components": "3.0.1401",
"@cloudscape-design/global-styles": "1.0.60",
"react": "19.2.7",
"react-dom": "19.2.7"
},
"devDependencies": {
"axe-core": "4.12.1",
"playwright": "1.61.1",
"vite": "6.4.3"
}
}
index.html
<!doctype html>
<html lang="en">
<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>AppLayout mobile ARIA reproduction</title></head>
<body style="margin:0"><div id="root"></div><script type="module" src="/main.jsx"></script></body>
</html>
main.jsx
import React, { useState } from "react";
import { createRoot } from "react-dom/client";
import AppLayout from "@cloudscape-design/components/app-layout";
import AppLayoutToolbar from "@cloudscape-design/components/app-layout-toolbar";
import "@cloudscape-design/global-styles/index.css";
function Reproduction() {
const [navigationOpen, setNavigationOpen] = useState(false);
const Layout = new URLSearchParams(location.search).get("layout") === "toolbar"
? AppLayoutToolbar
: AppLayout;
return (
<Layout
navigation={<a href="#content">Example section</a>}
navigationOpen={navigationOpen}
onNavigationChange={({ detail }) => setNavigationOpen(detail.open)}
toolsHide
ariaLabels={{
navigation: "Navigation",
navigationToggle: "Open navigation",
navigationClose: "Close navigation",
}}
content={<h1 id="content">Minimal AppLayout reproduction</h1>}
/>
);
}
createRoot(document.getElementById("root")).render(<Reproduction />);
capture.mjs
import fs from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { createServer } from "vite";
import { chromium } from "playwright";
import axe from "axe-core";
const root = path.dirname(fileURLToPath(import.meta.url));
const output = path.join(root, "evidence");
const pkg = JSON.parse(await fs.readFile(path.join(root, "package.json"), "utf8"));
await fs.mkdir(output, { recursive: true });
const server = await createServer({ root, configFile: false, server: { host: "127.0.0.1", port: 0 } });
await server.listen();
const address = server.httpServer.address();
const baseUrl = `http://127.0.0.1:${address.port}/`;
const browser = await chromium.launch({
headless: true,
...(process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH
? { executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH }
: {}),
});
const report = {
checkedAt: new Date().toISOString(),
environment: { node: process.version, platform: process.platform, browser: browser.version(), ...pkg.dependencies, axe: pkg.devDependencies["axe-core"] },
cases: [],
};
async function scan(page, name) {
await page.addScriptTag({ content: axe.source });
const result = await page.evaluate(() => axe.run(document, {
runOnly: { type: "tag", values: ["wcag2a", "wcag2aa", "wcag21aa"] },
}));
const violations = result.violations.map(({ id, impact, help, nodes }) => ({
id, impact, help, nodes: nodes.map(({ html, target, failureSummary }) => ({ html, target, failureSummary })),
}));
await page.screenshot({ path: path.join(output, name + ".png"), fullPage: true });
report.cases.push({ name, viewport: page.viewportSize(), violations });
console.log(`${violations.length ? "FAIL" : "PASS"} ${name}: ${violations.map(v => v.id).join(", ") || "no WCAG violations"}`);
}
try {
for (const [width, height] of [[390, 844], [1280, 900]]) {
const page = await browser.newPage({ viewport: { width, height } });
const errors = [];
page.on("pageerror", error => errors.push(error.message));
await page.goto(baseUrl, { waitUntil: "networkidle" });
await page.getByRole("heading", { name: "Minimal AppLayout reproduction" }).waitFor();
await scan(page, width === 390 ? "app-layout-mobile-closed" : "app-layout-desktop-closed");
if (width === 390) {
await page.getByRole("button", { name: "Open navigation", exact: true }).click();
await page.getByRole("link", { name: "Example section" }).waitFor();
// Let the drawer's opacity transition finish before testing contrast.
await page.waitForTimeout(500);
await scan(page, "app-layout-mobile-open");
}
if (errors.length) throw new Error(errors.join("; "));
await page.close();
}
const page = await browser.newPage({ viewport: { width: 390, height: 844 } });
await page.goto(baseUrl + "?layout=toolbar", { waitUntil: "networkidle" });
await page.getByRole("heading", { name: "Minimal AppLayout reproduction" }).waitFor();
await scan(page, "app-layout-toolbar-mobile-closed");
await page.close();
} finally {
await browser.close();
await server.close();
}
await fs.writeFile(path.join(output, "report.json"), JSON.stringify(report, null, 2) + "\n");
// This is a strict regression check: exit 1 is expected while the bug exists.
if (report.cases.some(test => test.violations.length > 0)) process.exitCode = 1;
Captured strict scan results
Both builds succeeded. In both runs, pnpm test exited 1 because the mobile closed-state case reports one aria-allowed-attr violation; the three control cases pass. The 500 ms wait in the open-state case lets the navigation opacity transition complete before checking color contrast.
SDK 3.0.1310 — report.json
{
"checkedAt": "2026-10-16T11:02:01.470Z",
"environment": {
"node": "v24.19.0",
"platform": "win32",
"browser": "149.0.7827.55",
"@cloudscape-design/components": "3.0.1310",
"@cloudscape-design/global-styles": "1.0.60",
"react": "19.2.7",
"react-dom": "19.2.7",
"axe": "4.12.1"
},
"cases": [
{
"name": "app-layout-mobile-closed",
"viewport": {
"width": 390,
"height": 844
},
"violations": [
{
"id": "aria-allowed-attr",
"impact": "critical",
"help": "Elements must only use supported ARIA attributes",
"nodes": [
{
"html": "<nav aria-hidden=\"false\" aria-label=\"Navigation\" aria-orientation=\"horizontal\" class=\"awsui_mobile-toolbar-nav_hyvsj_ffxhy_675 awsui_drawer-closed_1fj9k_q6akd_15\">",
"target": [
".awsui_mobile-toolbar-nav_hyvsj_ffxhy_675"
],
"failureSummary": "Fix all of the following:\n ARIA attribute is not allowed: aria-orientation=\"horizontal\""
}
]
}
]
},
{
"name": "app-layout-mobile-open",
"viewport": {
"width": 390,
"height": 844
},
"violations": []
},
{
"name": "app-layout-desktop-closed",
"viewport": {
"width": 1280,
"height": 900
},
"violations": []
},
{
"name": "app-layout-toolbar-mobile-closed",
"viewport": {
"width": 390,
"height": 844
},
"violations": []
}
]
}
SDK 3.0.1401 — report.json
{
"checkedAt": "2026-10-16T11:02:00.110Z",
"environment": {
"node": "v24.19.0",
"platform": "win32",
"browser": "149.0.7827.55",
"@cloudscape-design/components": "3.0.1401",
"@cloudscape-design/global-styles": "1.0.60",
"react": "19.2.7",
"react-dom": "19.2.7",
"axe": "4.12.1"
},
"cases": [
{
"name": "app-layout-mobile-closed",
"viewport": {
"width": 390,
"height": 844
},
"violations": [
{
"id": "aria-allowed-attr",
"impact": "critical",
"help": "Elements must only use supported ARIA attributes",
"nodes": [
{
"html": "<nav aria-hidden=\"false\" aria-label=\"Navigation\" aria-orientation=\"horizontal\" class=\"awsui_mobile-toolbar-nav_hyvsj_16epy_499 awsui_drawer-closed_1fj9k_q6akd_15\">",
"target": [
".awsui_mobile-toolbar-nav_hyvsj_16epy_499"
],
"failureSummary": "Fix all of the following:\n ARIA attribute is not allowed: aria-orientation=\"horizontal\""
}
]
}
]
},
{
"name": "app-layout-mobile-open",
"viewport": {
"width": 390,
"height": 844
},
"violations": []
},
{
"name": "app-layout-desktop-closed",
"viewport": {
"width": 1280,
"height": 900
},
"violations": []
},
{
"name": "app-layout-toolbar-mobile-closed",
"viewport": {
"width": 390,
"height": 844
},
"violations": []
}
]
}
Duplicate search
On 2026-10-16, issue-only searches in this repository for "aria-orientation" and "aria-allowed-attr" returned no matching issues. This does not establish that no related issue exists under another description.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.7k
- Fork
- 248
- Merge trung bình
- 3 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 83
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudscape-design/components
-
[Bug]: Circular app layout navigation and help icons are shifted upward in the official demoĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
cloudscape-design/components#5184 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
cloudscape-design/components#5149 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
cloudscape-design/components#5117 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
cloudscape-design/components#5106 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug/Feature Request]: `usePerformanceMarks` has ID generation incompatible with Next.js Partial PrerenderingCó thể đã có người làm @amanabiy đã nhận 23 ngày trước. Đang mởenhancement
cloudscape-design/components#5023 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của cloudscape-design/components
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
farion1231/cc-switch#8829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverĐang mởdoc-audit enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100