File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -373,15 +373,17 @@ import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
373373
374374 const wc = this ;
375375 const resizeObserver = new ResizeObserver ( entries => {
376- for ( let entry of entries ) {
377- if ( entry . contentBoxSize ) {
378- var size = wc . shadowRoot . host . offsetWidth ;
379- wc . _inputStartElement . shadowRoot . querySelector ( '[part="label"]' )
380- . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
381- wc . _inputStartElement . shadowRoot . querySelector ( '[part="error-message"]' )
382- . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
376+ requestAnimationFrame ( ( ) => {
377+ for ( let entry of entries ) {
378+ if ( entry . contentBoxSize ) {
379+ var size = wc . shadowRoot . host . offsetWidth ;
380+ wc . _inputStartElement . shadowRoot . querySelector ( '[part="label"]' )
381+ . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
382+ wc . _inputStartElement . shadowRoot . querySelector ( '[part="error-message"]' )
383+ . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
384+ }
383385 }
384- }
386+ } ) ;
385387 } ) ;
386388
387389 resizeObserver . observe ( this ) ;
You can’t perform that action at this time.
0 commit comments