From 15a603b39797dee6baf7e33d58907f98ced7e86d Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 23 Apr 2020 12:15:54 -0400 Subject: [PATCH] fix(searchbar): screen readers correctly announce the cancel button text (#21049) fixes #21013 --- core/src/components/searchbar/searchbar.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/components/searchbar/searchbar.tsx b/core/src/components/searchbar/searchbar.tsx index 83af4f082a..139e073c99 100644 --- a/core/src/components/searchbar/searchbar.tsx +++ b/core/src/components/searchbar/searchbar.tsx @@ -420,24 +420,29 @@ export class Searchbar implements ComponentInterface { } render() { + const { cancelButtonText } = this; const animated = this.animated && config.getBoolean('animated', true); const mode = getIonMode(this); const clearIcon = this.clearIcon || (mode === 'ios' ? 'close-circle' : 'close-sharp'); const searchIcon = this.searchIcon || (mode === 'ios' ? 'search-outline' : 'search-sharp'); + const shouldShowCancelButton = this.shouldShowCancelButton(); const cancelButton = (this.showCancelButton !== 'never') && ( @@ -481,7 +486,7 @@ export class Searchbar implements ComponentInterface { {mode === 'md' && cancelButton} - +