@@ -17,7 +17,6 @@ export class EditorFilterControl extends EditorButtonControl {
1717 private _originalUrl = '' ;
1818 private _observer ?: IntersectionObserver ;
1919 private _cancelPreload ?: ( ) => void ;
20- private _labelsBound = false ;
2120 private _lastPreviewRequestId = 0 ;
2221 private previewVisibilityCheckRaf ?: number ;
2322 private previewVisibilityCheckTimeout ?: number ;
@@ -125,7 +124,7 @@ export class EditorFilterControl extends EditorButtonControl {
125124 this . schedulePreviewVisibilityCheck ( ) ;
126125 }
127126
128- if ( this . _filter && ! this . _labelsBound ) {
127+ if ( this . _filter ) {
129128 this . updateFilterLabels ( this . _filter ) ;
130129 }
131130
@@ -167,19 +166,14 @@ export class EditorFilterControl extends EditorButtonControl {
167166
168167 private updateFilterLabels ( filterName : string ) : void {
169168 if ( ! filterName ) {
169+ this . titleProp = '' ;
170170 return ;
171171 }
172172
173- const resolveTitleProp = ( ) => {
174- const label = this . l10n ( 'a11y-cloud-editor-apply-filter' , {
175- name : filterName . toLowerCase ( ) ,
176- } ) ;
177- this . titleProp = label ;
178- return label ;
179- } ;
180-
181- resolveTitleProp ( ) ;
182- this . _labelsBound = false ;
173+ const label = this . l10n ( 'a11y-cloud-editor-apply-filter' , {
174+ name : filterName . toLowerCase ( ) ,
175+ } ) ;
176+ this . titleProp = label ;
183177 }
184178
185179 private async loadPreview ( observer ?: IntersectionObserver ) : Promise < void > {
@@ -293,8 +287,8 @@ export class EditorFilterControl extends EditorButtonControl {
293287 role ="option "
294288 type ="button "
295289 class =${ classMap ( this . buttonClasses ) }
296- aria-label =${ ifDefined ( this . computedAriaLabel ) }
297- title=${ ifDefined ( this . computedAriaLabel ) }
290+ aria-label =${ ifDefined ( this . titleProp ) }
291+ title=${ ifDefined ( this . titleProp ) }
298292 @click=${ clickHandler }
299293 >
300294 < div class ="uc-preview " ?loaded =${ this . previewLoaded } style =${ styleMap ( previewStyles ) } > </ div >
0 commit comments