feat(Popup): add role and tabindex for a11y (#10894)

* feat(Popup): add role and tabindex for a11y

* Update Popup.tsx

Co-authored-by: neverland <jait.chen@foxmail.com>
This commit is contained in:
richex-cn 2022-08-09 10:04:13 +08:00 committed by GitHub
parent b117e21dc4
commit ed5ea225ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,6 +144,8 @@ export default defineComponent({
zIndex={zIndex.value} zIndex={zIndex.value}
duration={props.duration} duration={props.duration}
customStyle={props.overlayStyle} customStyle={props.overlayStyle}
role={props.closeOnClickOverlay ? 'button' : undefined}
tabindex={props.closeOnClickOverlay ? 0 : undefined}
onClick={onClickOverlay} onClick={onClickOverlay}
/> />
); );
@ -185,6 +187,8 @@ export default defineComponent({
v-show={props.show} v-show={props.show}
ref={popupRef} ref={popupRef}
style={style.value} style={style.value}
role="dialog"
tabindex={0}
class={[ class={[
bem({ bem({
round, round,