File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -316,27 +316,28 @@ class Blocks extends React.Component {
316316 const selectedCategoryScrollPosition =
317317 this . workspace
318318 . getFlyout ( )
319- . getCategoryScrollPosition ( selectedCategoryName ) . y * scale ;
319+ . getCategoryScrollPosition ( selectedCategoryName ) * scale ;
320320 const offsetWithinCategory =
321321 this . workspace . getFlyout ( ) . getWorkspace ( ) . getMetrics ( ) . viewTop -
322322 selectedCategoryScrollPosition ;
323323
324324 this . workspace . updateToolbox ( this . props . toolboxXML ) ;
325+ this . workspace . getToolbox ( ) . runAfterRerender ( ( ) => {
326+ const newCategoryScrollPosition = this . workspace
327+ . getFlyout ( )
328+ . getCategoryScrollPosition ( selectedCategoryName ) ;
329+ if ( newCategoryScrollPosition ) {
330+ this . workspace
331+ . getFlyout ( )
332+ . getWorkspace ( )
333+ . scrollbar . setY (
334+ newCategoryScrollPosition * scale + offsetWithinCategory
335+ ) ;
336+ }
337+ } ) ;
325338 this . workspace . getToolbox ( ) . forceRerender ( ) ;
326339 this . _renderedToolboxXML = this . props . toolboxXML ;
327340
328- const newCategoryScrollPosition = this . workspace
329- . getFlyout ( )
330- . getCategoryScrollPosition ( selectedCategoryName ) ;
331- if ( newCategoryScrollPosition ) {
332- this . workspace
333- . getFlyout ( )
334- . getWorkspace ( )
335- . scrollbar . setY (
336- newCategoryScrollPosition . y * scale + offsetWithinCategory
337- ) ;
338- }
339-
340341 const queue = this . toolboxUpdateQueue ;
341342 this . toolboxUpdateQueue = [ ] ;
342343 queue . forEach ( ( fn ) => fn ( ) ) ;
You can’t perform that action at this time.
0 commit comments