From 3a56703cb04feadf917b539afcd58f33baf5f562 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 16 Nov 2021 21:21:47 +0800 Subject: [PATCH] feat(Tabs): add aria-controls for a11y (#9882) * feat(Tabs): add aria-controls for a11y * test: keep jest snapshot stable --- .../test/__snapshots__/index.spec.ts.snap | 12 +- packages/vant/src/composables/use-id.ts | 15 + .../test/__snapshots__/index.spec.ts.snap | 72 ++- .../test/__snapshots__/demo.spec.ts.snap | 27 +- .../icon/test/__snapshots__/demo.spec.ts.snap | 36 +- .../test/__snapshots__/demo.spec.ts.snap | 18 +- .../list/test/__snapshots__/demo.spec.ts.snap | 27 +- .../test/__snapshots__/demo.spec.ts.snap | 27 +- packages/vant/src/tab/Tab.tsx | 20 +- .../tab/test/__snapshots__/demo.spec.ts.snap | 417 ++++++++++++++---- .../test/__snapshots__/index.spec.tsx.snap | 166 +++++-- .../test/__snapshots__/insert.spec.tsx.snap | 72 ++- packages/vant/src/tabs/Tabs.tsx | 5 + packages/vant/src/tabs/TabsTitle.tsx | 4 + packages/vant/src/tabs/types.ts | 1 + packages/vant/src/vue-tsx-shim.d.ts | 1 + 16 files changed, 731 insertions(+), 189 deletions(-) create mode 100644 packages/vant/src/composables/use-id.ts diff --git a/packages/vant/src/cascader/test/__snapshots__/index.spec.ts.snap b/packages/vant/src/cascader/test/__snapshots__/index.spec.ts.snap index 185f67837..c21648631 100644 --- a/packages/vant/src/cascader/test/__snapshots__/index.spec.ts.snap +++ b/packages/vant/src/cascader/test/__snapshots__/index.spec.ts.snap @@ -62,7 +62,8 @@ exports[`should update tabs when previous tab is clicked 1`] = ` class="van-tabs__nav van-tabs__nav--line van-tabs__nav--complete" aria-orientation="horizontal" > - -