File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ This may be appropriate if the underlying row data has changed but the row sizes
6161
6262Gets offset for a given row and alignment.
6363
64+ ##### getScrollbarWidth
65+
66+ Gets the scrollbar width used to pad the table-header.
67+
6468##### measureAllRows
6569Pre-measure all rows in a ` Table ` .
6670
Original file line number Diff line number Diff line change @@ -337,6 +337,17 @@ export default class Table extends React.PureComponent {
337337 }
338338 }
339339
340+ getScrollbarWidth ( ) {
341+ if ( this . Grid ) {
342+ const Grid = findDOMNode ( this . Grid ) ;
343+ const clientWidth = Grid . clientWidth || 0 ;
344+ const offsetWidth = Grid . offsetWidth || 0 ;
345+ return offsetWidth - clientWidth ;
346+ }
347+
348+ return 0 ;
349+ }
350+
340351 componentDidMount ( ) {
341352 this . _setScrollbarWidth ( ) ;
342353 }
@@ -726,13 +737,8 @@ export default class Table extends React.PureComponent {
726737 }
727738
728739 _setScrollbarWidth ( ) {
729- if ( this . Grid ) {
730- const Grid = findDOMNode ( this . Grid ) ;
731- const clientWidth = Grid . clientWidth || 0 ;
732- const offsetWidth = Grid . offsetWidth || 0 ;
733- const scrollbarWidth = offsetWidth - clientWidth ;
740+ const scrollbarWidth = this . getScrollbarWidth ( ) ;
734741
735- this . setState ( { scrollbarWidth} ) ;
736- }
742+ this . setState ( { scrollbarWidth} ) ;
737743 }
738744}
You can’t perform that action at this time.
0 commit comments