diff --git a/packages/e2e/cypress/e2e/gmail-spec.cy.ts b/packages/e2e/cypress/e2e/gmail-spec.cy.ts index f51febd..f317eef 100644 --- a/packages/e2e/cypress/e2e/gmail-spec.cy.ts +++ b/packages/e2e/cypress/e2e/gmail-spec.cy.ts @@ -64,14 +64,14 @@ describe("Testing the Gmail Demo", () => { cy.focused().type("a"); cy.focused().type("Root{enter}"); cy.get("@item").contains("Root").click(); - cy.focused().should("have.attr", "aria-level", "0"); + cy.focused().should("have.attr", "aria-level", "1"); // On a folder that is open cy.get("@item").contains("Categories").click(); // opened it cy.focused().type("a"); cy.focused().type("Child{enter}"); cy.get("@item").contains("Child").click(); - cy.focused().should("have.attr", "aria-level", "1"); + cy.focused().should("have.attr", "aria-level", "2"); }); it("Creates Internal Nodes", () => { @@ -95,14 +95,14 @@ describe("Testing the Gmail Demo", () => { cy.focused().type("Root{enter}"); cy.get("@item").contains("Root").click(); cy.focused().children().should("have.class", "isInternal"); - cy.focused().should("have.attr", "aria-level", "0"); + cy.focused().should("have.attr", "aria-level", "1"); // On a folder that is open cy.get("@item").contains("Categories").click(); // opened it cy.focused().type("A"); cy.focused().type("Child{enter}"); cy.get("@item").contains("Child").click(); - cy.focused().should("have.attr", "aria-level", "1"); + cy.focused().should("have.attr", "aria-level", "2"); }); it("drags and drops in its list", () => { diff --git a/packages/react-arborist/src/components/default-container.tsx b/packages/react-arborist/src/components/default-container.tsx index 9296cac..1c57956 100644 --- a/packages/react-arborist/src/components/default-container.tsx +++ b/packages/react-arborist/src/components/default-container.tsx @@ -18,6 +18,7 @@ export function DefaultContainer() { const tree = useTreeApi(); return (
({ ); const rowAttrs: React.HTMLAttributes = { role: "treeitem", - "aria-level": node.level, + "aria-level": node.level + 1, "aria-selected": node.isSelected, style: rowStyle, tabIndex: -1,