File tree 1 file changed +3
-3
lines changed
packages/react-data-grid/src 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default class HeaderCell extends React.Component {
33
33
34
34
state = { resizing : false } ;
35
35
36
- headerCellRef = ( node ) => this . headerCell = node ;
36
+ headerCell = React . createRef ( ) ;
37
37
38
38
onDragStart = ( e ) => {
39
39
this . setState ( { resizing : true } ) ;
@@ -59,7 +59,7 @@ export default class HeaderCell extends React.Component {
59
59
60
60
getWidthFromMouseEvent = ( e ) => {
61
61
const right = e . pageX || ( e . touches && e . touches [ 0 ] && e . touches [ 0 ] . pageX ) || ( e . changedTouches && e . changedTouches [ e . changedTouches . length - 1 ] . pageX ) ;
62
- const left = ReactDOM . findDOMNode ( this ) . getBoundingClientRect ( ) . left ;
62
+ const left = this . headerCell . current ? this . headerCell . current . getBoundingClientRect ( ) . left : 0 ;
63
63
return right - left ;
64
64
} ;
65
65
@@ -120,7 +120,7 @@ export default class HeaderCell extends React.Component {
120
120
'react-grid-HeaderCell--frozen' : isFrozen ( column )
121
121
} , this . props . className , column . cellClass ) ;
122
122
const cell = (
123
- < div ref = { this . headerCellRef } className = { className } style = { this . getStyle ( ) } >
123
+ < div ref = { this . headerCell } className = { className } style = { this . getStyle ( ) } >
124
124
{ this . getCell ( ) }
125
125
{ resizeHandle }
126
126
</ div >
You can’t perform that action at this time.
0 commit comments