@@ -3263,7 +3263,6 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
32633263 }
32643264 }
32653265 }
3266- console . log ( { event, details} , "keys.contextMenu:" , keys . contextMenu , overlayOpen )
32673266
32683267 if ( details . didMatch ) {
32693268 cancel ( ) ;
@@ -3363,6 +3362,34 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
33633362 col = Number . MAX_SAFE_INTEGER ;
33643363 } else if ( isHotkey ( keys . goToFirstColumn , event , details ) ) {
33653364 col = Number . MIN_SAFE_INTEGER ;
3365+ } else if ( isHotkey ( keys . contextMenu , event , details ) &&
3366+ bounds !== undefined &&
3367+ event . location !== undefined
3368+ ) {
3369+ const {
3370+ location,
3371+ ctrlKey,
3372+ metaKey,
3373+ shiftKey,
3374+ } = event ;
3375+
3376+ onContextMenu (
3377+ {
3378+ kind : "cell" ,
3379+ isFillHandle : false ,
3380+ isTouch : false ,
3381+ isEdge : false ,
3382+ button : 0 ,
3383+ scrollEdge : [ 0 , 0 ] ,
3384+ localEventX : bounds . width / 2 ,
3385+ localEventY : bounds . height / 2 ,
3386+ location,
3387+ bounds,
3388+ ctrlKey,
3389+ metaKey,
3390+ shiftKey,
3391+ buttons : 0
3392+ } , cancel )
33663393 } else if ( rangeSelect === "rect" || rangeSelect === "multi-rect" ) {
33673394 if ( isHotkey ( keys . selectGrowDown , event , details ) ) {
33683395 adjustSelection ( [ 0 , 1 ] ) ;
@@ -3380,27 +3407,6 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
33803407 adjustSelection ( [ 2 , 0 ] ) ;
33813408 } else if ( isHotkey ( keys . selectToFirstColumn , event , details ) ) {
33823409 adjustSelection ( [ - 2 , 0 ] ) ;
3383- } else if ( isHotkey ( keys . contextMenu , event , details ) &&
3384- event . bounds !== undefined &&
3385- event . location !== undefined
3386- ) {
3387- onContextMenu (
3388- {
3389- kind : "cell" ,
3390- isFillHandle : false ,
3391- isTouch : false ,
3392- isEdge : false ,
3393- button : 0 ,
3394- scrollEdge : [ 0 , 0 ] ,
3395- localEventX : event . bounds . width / 2 ,
3396- localEventY : event . bounds . height / 2 ,
3397- location : [ col , row ] ,
3398- bounds : event . bounds ,
3399- ctrlKey : false ,
3400- metaKey : false ,
3401- shiftKey : true ,
3402- buttons : 0
3403- } , cancel )
34043410 }
34053411 }
34063412 cancelOnlyOnMove = details . didMatch ;
0 commit comments