@@ -153,6 +153,8 @@ export default class DataBrowser extends React.Component {
153153 contextMenuX : null ,
154154 contextMenuY : null ,
155155 contextMenuItems : null ,
156+ panelCheckboxDragging : false ,
157+ draggedPanelSelection : false ,
156158 } ;
157159
158160 this . handleResizeDiv = this . handleResizeDiv . bind ( this ) ;
@@ -186,6 +188,9 @@ export default class DataBrowser extends React.Component {
186188 this . handlePanelScroll = this . handlePanelScroll . bind ( this ) ;
187189 this . handlePanelHeaderContextMenu = this . handlePanelHeaderContextMenu . bind ( this ) ;
188190 this . handleWrapperWheel = this . handleWrapperWheel . bind ( this ) ;
191+ this . onMouseDownPanelCheckBox = this . onMouseDownPanelCheckBox . bind ( this ) ;
192+ this . onMouseUpPanelCheckBox = this . onMouseUpPanelCheckBox . bind ( this ) ;
193+ this . onMouseEnterPanelCheckBox = this . onMouseEnterPanelCheckBox . bind ( this ) ;
189194 this . saveOrderTimeout = null ;
190195 this . aggregationPanelRef = React . createRef ( ) ;
191196 this . panelColumnRefs = [ ] ;
@@ -265,6 +270,7 @@ export default class DataBrowser extends React.Component {
265270 async componentDidMount ( ) {
266271 document . body . addEventListener ( 'keydown' , this . handleKey ) ;
267272 window . addEventListener ( 'resize' , this . updateMaxWidth ) ;
273+ window . addEventListener ( 'mouseup' , this . onMouseUpPanelCheckBox ) ;
268274
269275 // Load keyboard shortcuts from server
270276 try {
@@ -279,6 +285,7 @@ export default class DataBrowser extends React.Component {
279285 componentWillUnmount ( ) {
280286 document . body . removeEventListener ( 'keydown' , this . handleKey ) ;
281287 window . removeEventListener ( 'resize' , this . updateMaxWidth ) ;
288+ window . removeEventListener ( 'mouseup' , this . onMouseUpPanelCheckBox ) ;
282289 if ( this . multiPanelWrapperElement ) {
283290 this . multiPanelWrapperElement . removeEventListener ( 'wheel' , this . handleWrapperWheel ) ;
284291 }
@@ -1136,6 +1143,30 @@ export default class DataBrowser extends React.Component {
11361143 } ) ;
11371144 }
11381145
1146+ onMouseDownPanelCheckBox ( objectId , checked ) {
1147+ const newSelectionState = ! checked ;
1148+ this . props . selectRow ( objectId , newSelectionState ) ;
1149+ this . setState ( {
1150+ panelCheckboxDragging : true ,
1151+ draggedPanelSelection : newSelectionState ,
1152+ } ) ;
1153+ }
1154+
1155+ onMouseUpPanelCheckBox ( ) {
1156+ if ( this . state . panelCheckboxDragging ) {
1157+ this . setState ( {
1158+ panelCheckboxDragging : false ,
1159+ draggedPanelSelection : false ,
1160+ } ) ;
1161+ }
1162+ }
1163+
1164+ onMouseEnterPanelCheckBox ( objectId ) {
1165+ if ( this . state . panelCheckboxDragging ) {
1166+ this . props . selectRow ( objectId , this . state . draggedPanelSelection ) ;
1167+ }
1168+ }
1169+
11391170 handleWrapperWheel ( event ) {
11401171 if ( ! this . state . syncPanelScroll || this . state . panelCount <= 1 ) {
11411172 return ;
@@ -1734,12 +1765,12 @@ export default class DataBrowser extends React.Component {
17341765 { this . state . showPanelCheckbox && (
17351766 < div
17361767 className = { styles . panelHeader }
1737- onClick = { ( ) => {
1738- this . props . selectRow ( objectId , ! isRowSelected ) ;
1739- } }
17401768 onMouseDown = { ( e ) => {
17411769 e . preventDefault ( ) ;
1770+ this . onMouseDownPanelCheckBox ( objectId , isRowSelected ) ;
17421771 } }
1772+ onMouseUp = { this . onMouseUpPanelCheckBox }
1773+ onMouseEnter = { ( ) => this . onMouseEnterPanelCheckBox ( objectId ) }
17431774 onContextMenu = { ( e ) => {
17441775 e . preventDefault ( ) ;
17451776 this . handlePanelHeaderContextMenu ( e , objectId ) ;
0 commit comments