fix(back-button): screen readers correctly announce the back button text (#21053)

fixes #21043
This commit is contained in:
Liam DeBeasi
2020-04-27 11:31:32 -04:00
committed by GitHub
parent 66e8e6404d
commit 14c226ce75

View File

@ -126,10 +126,10 @@ export class BackButton implements ComponentInterface, ButtonInterface {
'show-back-button': showBackButton 'show-back-button': showBackButton
}} }}
> >
<button type={type} disabled={disabled} class="button-native" part="button"> <button type={type} disabled={disabled} class="button-native" part="button" aria-label={backButtonText || 'back'}>
<span class="button-inner"> <span class="button-inner">
{backButtonIcon && <ion-icon icon={backButtonIcon} lazy={false} part="icon"></ion-icon>} {backButtonIcon && <ion-icon icon={backButtonIcon} aria-hidden="true" lazy={false} part="icon"></ion-icon>}
{backButtonText && <span class="button-text" part="text">{backButtonText}</span>} {backButtonText && <span aria-hidden="true" class="button-text" part="text">{backButtonText}</span>}
</span> </span>
{mode === 'md' && <ion-ripple-effect type={this.rippleType}></ion-ripple-effect>} {mode === 'md' && <ion-ripple-effect type={this.rippleType}></ion-ripple-effect>}
</button> </button>