@@ -136,8 +136,8 @@ export class ComboBoxScroller extends PolymerElement {
136136 }
137137
138138 __openedChanged ( opened ) {
139- if ( this . __virtualizer && opened ) {
140- this . __virtualizer . update ( ) ;
139+ if ( opened ) {
140+ this . requestContentUpdate ( ) ;
141141 }
142142 }
143143
@@ -163,6 +163,12 @@ export class ComboBoxScroller extends PolymerElement {
163163 } ) ;
164164 }
165165
166+ requestContentUpdate ( ) {
167+ if ( this . __virtualizer ) {
168+ this . __virtualizer . update ( ) ;
169+ }
170+ }
171+
166172 scrollIntoView ( index ) {
167173 if ( ! ( this . opened && index >= 0 ) ) {
168174 return ;
@@ -232,29 +238,29 @@ export class ComboBoxScroller extends PolymerElement {
232238 this . __virtualizer . flush ( ) ;
233239 // Ensure the total count of items is properly announced.
234240 this . setAttribute ( 'aria-setsize' , items . length ) ;
235- this . __virtualizer . update ( ) ;
241+ this . requestContentUpdate ( ) ;
236242 }
237243 }
238244
239245 /** @private */
240246 __loadingChanged ( loading ) {
241247 if ( this . __virtualizer && ! loading ) {
242- setTimeout ( ( ) => this . __virtualizer . update ( ) ) ;
248+ setTimeout ( ( ) => this . requestContentUpdate ( ) ) ;
243249 }
244250 }
245251
246252 /** @private */
247253 __focusedIndexChanged ( index ) {
248254 if ( this . __virtualizer && index >= 0 ) {
249- this . __virtualizer . update ( ) ;
255+ this . requestContentUpdate ( ) ;
250256 this . scrollIntoView ( index ) ;
251257 }
252258 }
253259
254260 /** @private */
255261 __rendererChanged ( renderer , oldRenderer ) {
256- if ( this . __virtualizer && ( renderer || oldRenderer ) ) {
257- this . __virtualizer . update ( ) ;
262+ if ( renderer || oldRenderer ) {
263+ this . requestContentUpdate ( ) ;
258264 }
259265 }
260266
0 commit comments