@@ -4,7 +4,7 @@ import { InputType } from "helpers/Constants";
44import { c , getAlignmentClassname } from "helpers/StylesHelper" ;
55import { Notice } from "obsidian" ;
66import { Link } from "obsidian-dataview" ;
7- import React , { MouseEventHandler , useEffect , useRef , useState } from "react" ;
7+ import React , { useEffect , useRef , useState } from "react" ;
88import { DataviewService } from "services/DataviewService" ;
99import { ParseService } from "services/ParseService" ;
1010import RelationEditor from "components/cellTypes/Editor/RelationEditor" ;
@@ -87,8 +87,7 @@ const RelationCell = (mdProps: CellComponentProps) => {
8787 setDirtyCell ( false ) ;
8888 } ;
8989
90- const handleOnClick : MouseEventHandler < HTMLSpanElement > = ( event ) => {
91- event . stopPropagation ( ) ;
90+ const handleOnClick = ( ) => {
9291 // Check if the column has a relation asotiated
9392 if ( tableColumn . config . related_note_path ) {
9493 setDirtyCell ( true ) ;
@@ -112,8 +111,19 @@ const RelationCell = (mdProps: CellComponentProps) => {
112111 onClick = { handleOnClick }
113112 style = { { width : column . getSize ( ) } }
114113 className = { c (
115- getAlignmentClassname ( tableColumn . config , configInfo . getLocalSettings ( ) )
114+ getAlignmentClassname (
115+ tableColumn . config ,
116+ configInfo . getLocalSettings ( ) ,
117+ [ "tabIndex" ]
118+ )
116119 ) }
120+ onKeyDown = { ( e ) => {
121+ if ( e . key === "Enter" ) {
122+ e . preventDefault ( ) ;
123+ handleOnClick ( ) ;
124+ }
125+ } }
126+ tabIndex = { 0 }
117127 />
118128 ) ;
119129} ;
0 commit comments