Skip to content

Commit

Permalink
updateLayout on next tick to work around layout problems, see #725
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jul 13, 2021
1 parent 063368f commit e012873
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/NavigationBarScreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @author Chris Malley (PixelZoom, Inc.)
*/

import animationFrameTimer from '../../axon/js/animationFrameTimer.js';
import DerivedProperty from '../../axon/js/DerivedProperty.js';
import Property from '../../axon/js/Property.js';
import Utils from '../../dot/js/Utils.js';
Expand Down Expand Up @@ -202,6 +203,10 @@ class NavigationBarScreenButton extends Node {
screen.nameProperty.link( name => {
text.text = name;
updateLayout();

// For unknown reasons, the layout must be adjusted later than something else. Unclear what else is happening,
// but this seems to work until we have a better long-term solution here
animationFrameTimer.runOnNextTick( updateLayout );
} );

// pdom - Pass a shape to the focusHighlight to prevent dilation, then tweak the top up just a hair.
Expand Down

0 comments on commit e012873

Please sign in to comment.