Don't attempt to scroll NavigationTable until it is attached
Computing the scroll information for an unattached table is useless. The UI state is not known and may be updated at a later point in time. This skips a bit of unnecessary work when a table is built in the background, like FileTable does for ChangeScreen2. Change-Id: I2892ae36a80f5158e30e019ebf9d6e865e348e93
This commit is contained in:
		@@ -200,7 +200,7 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
 | 
				
			|||||||
      table.setWidget(newRow, C_ARROW, pointer);
 | 
					      table.setWidget(newRow, C_ARROW, pointer);
 | 
				
			||||||
      final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW));
 | 
					      final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW));
 | 
				
			||||||
      UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), true);
 | 
					      UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), true);
 | 
				
			||||||
      if (scroll) {
 | 
					      if (scroll && isAttached()) {
 | 
				
			||||||
        scrollIntoView(tr);
 | 
					        scrollIntoView(tr);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } else if (clear) {
 | 
					    } else if (clear) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user