From 5f7e65b637c6bbba88f2235109fffd7580659526 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 17 Nov 2021 16:31:00 +0800 Subject: [PATCH] feat(List): add role and tabindex for a11y (#9888) --- packages/vant/src/list/List.tsx | 7 ++++++- .../vant/src/list/test/__snapshots__/index.spec.js.snap | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/vant/src/list/List.tsx b/packages/vant/src/list/List.tsx index 3b1a3fcee..470a9a3e0 100644 --- a/packages/vant/src/list/List.tsx +++ b/packages/vant/src/list/List.tsx @@ -115,7 +115,12 @@ export default defineComponent({ const text = slots.error ? slots.error() : props.errorText; if (text) { return ( -
+
{text}
); diff --git a/packages/vant/src/list/test/__snapshots__/index.spec.js.snap b/packages/vant/src/list/test/__snapshots__/index.spec.js.snap index 77f465e68..009cb95db 100644 --- a/packages/vant/src/list/test/__snapshots__/index.spec.js.snap +++ b/packages/vant/src/list/test/__snapshots__/index.spec.js.snap @@ -5,7 +5,10 @@ exports[`should render error slot correctly 1`] = ` class="van-list" aria-busy="false" > -
+
Custom Error