From ed5ea225cab25d9b8ad8a4864f26dcdacff639a3 Mon Sep 17 00:00:00 2001 From: richex-cn Date: Tue, 9 Aug 2022 10:04:13 +0800 Subject: [PATCH] feat(Popup): add role and tabindex for a11y (#10894) * feat(Popup): add role and tabindex for a11y * Update Popup.tsx Co-authored-by: neverland --- packages/vant/src/popup/Popup.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vant/src/popup/Popup.tsx b/packages/vant/src/popup/Popup.tsx index 2095f0042..9c5f458cf 100644 --- a/packages/vant/src/popup/Popup.tsx +++ b/packages/vant/src/popup/Popup.tsx @@ -144,6 +144,8 @@ export default defineComponent({ zIndex={zIndex.value} duration={props.duration} customStyle={props.overlayStyle} + role={props.closeOnClickOverlay ? 'button' : undefined} + tabindex={props.closeOnClickOverlay ? 0 : undefined} onClick={onClickOverlay} /> ); @@ -185,6 +187,8 @@ export default defineComponent({ v-show={props.show} ref={popupRef} style={style.value} + role="dialog" + tabindex={0} class={[ bem({ round,