Fix circular view being rendered as a blank area if tab is opened in the background #3415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2921
Basically the initial load gets out of whack because the width is 0 (https://github.com/GMOD/jbrowse-components/compare/width_initialized_circular?expand=1#diff-73c3047508be77cca92bdbd3a5c691bd72be00e1cc3ebba7001c9cb1315d4070L107) in this case #2921
This code is similar to what the linear genome view does, it makes sure that setWidth has been called before trying to perform any operations. Possibly just making it non-zero can help, but i believe it's best to start loading after the browser has told us what space it has to render (this especially helps with linear genome view to avoid false-starts for data fetching)