After #1024 moves role="tablist" to .rc-tabs-nav-list, aria-required-children still fires for editable tabs: the add button (src/TabNavList/AddButton.tsx, rendered inside the nav list next to the tab nodes in src/TabNavList/index.tsx) is a button owned by the tablist, and a tablist may only own tab elements. axe-core flags it critical: "Element has children which are not allowed: button".
The remove button is the same class of problem, pre-existing: it renders as a sibling of the role="tab" node inside each tab wrapper, so the tablist owns it too.
Repro: <Tabs editable={{ onChange: ... }} items={...} /> through axe-core 4.13 flags the add button node with aria-required-children (critical). The same check on a non-editable Tabs is clean with #1024 applied, which is why this is carved out of that PR's scope.
What a fix likely needs:
- relocate the add button outside
[role=tablist] (or restructure so the tablist owns only tab nodes) while keeping the innerAddButtonRef size measurement working, it participates in the overflow calculation
- move the remove button inside each
role="tab" element, or give it the same restructuring
- matching CSS on the antd side for both moves
Context: remaining scope of the aria-required-children failure reported in ant-design/ant-design#49502; antd currently carries a waiting for fix exemption in the tabs a11y test (ant-design/ant-design#53584) that covers this.
After #1024 moves
role="tablist"to.rc-tabs-nav-list,aria-required-childrenstill fires for editable tabs: the add button (src/TabNavList/AddButton.tsx, rendered inside the nav list next to the tab nodes insrc/TabNavList/index.tsx) is abuttonowned by the tablist, and a tablist may only owntabelements. axe-core flags it critical: "Element has children which are not allowed: button".The remove button is the same class of problem, pre-existing: it renders as a sibling of the
role="tab"node inside each tab wrapper, so the tablist owns it too.Repro:
<Tabs editable={{ onChange: ... }} items={...} />through axe-core 4.13 flags the add button node witharia-required-children(critical). The same check on a non-editableTabsis clean with #1024 applied, which is why this is carved out of that PR's scope.What a fix likely needs:
[role=tablist](or restructure so the tablist owns only tab nodes) while keeping theinnerAddButtonRefsize measurement working, it participates in the overflow calculationrole="tab"element, or give it the same restructuringContext: remaining scope of the
aria-required-childrenfailure reported in ant-design/ant-design#49502; antd currently carries awaiting for fixexemption in the tabs a11y test (ant-design/ant-design#53584) that covers this.