feat(Popup): improvement accessibility of close icon (#4516)

This commit is contained in:
neverland 2019-09-20 20:17:28 +08:00 committed by GitHub
parent fa5bf00ff1
commit 92f5ac9143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -77,7 +77,13 @@ export default createComponent({
> >
{this.slots()} {this.slots()}
{this.closeable && ( {this.closeable && (
<Icon name={this.closeIcon} class={bem('close-icon', this.closeIconPosition)} onClick={this.close} /> <Icon
role="button"
tabindex="0"
name={this.closeIcon}
class={bem('close-icon', this.closeIconPosition)}
onClick={this.close}
/>
)} )}
</div> </div>
</transition> </transition>

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`close-icon prop 1`] = ` exports[`close-icon prop 1`] = `
<div class="van-popup van-popup--center" name="van-fade"><i class="van-icon van-icon-success van-popup__close-icon van-popup__close-icon--top-right"> <div class="van-popup van-popup--center" name="van-fade"><i role="button" tabindex="0" class="van-icon van-icon-success van-popup__close-icon van-popup__close-icon--top-right">
<!----></i></div> <!----></i></div>
`; `;