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 @@ -379,15 +379,17 @@ import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
379379
380380 const wc = this ;
381381 const resizeObserver = new ResizeObserver ( entries => {
382- for ( let entry of entries ) {
383- if ( entry . contentBoxSize ) {
384- var size = wc . shadowRoot . host . offsetWidth ;
385- wc . _inputStartElement . shadowRoot . querySelector ( '[part="label"]' )
386- . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
387- wc . _inputStartElement . shadowRoot . querySelector ( '[part="error-message"]' )
388- . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
382+ requestAnimationFrame ( ( ) => {
383+ for ( let entry of entries ) {
384+ if ( entry . contentBoxSize ) {
385+ var size = wc . shadowRoot . host . offsetWidth ;
386+ wc . _inputStartElement . shadowRoot . querySelector ( '[part="label"]' )
387+ . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
388+ wc . _inputStartElement . shadowRoot . querySelector ( '[part="error-message"]' )
389+ . setAttribute ( 'style' , "width: " + size + "px; max-width: max-content; overflow: hidden;" ) ;
390+ }
389391 }
390- }
392+ } ) ;
391393 } ) ;
392394
393395 resizeObserver . observe ( this ) ;
You can’t perform that action at this time.
0 commit comments