This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export default function DefaultCell(cellProperties: Cell) {
2222 const note : NoteInfo = ( cellProperties . row . original as any ) . note ;
2323 /** Ref to cell container */
2424 const containerCellRef = useRef < HTMLDivElement > ( ) ;
25+ const editableMdRef = useRef < HTMLInputElement > ( ) ;
2526 /** state of cell value */
2627 const [ contextValue , setContextValue ] = useState ( {
2728 value : initialValue ,
@@ -44,6 +45,12 @@ export default function DefaultCell(cellProperties: Cell) {
4445 }
4546 } , [ ] ) ;
4647
48+ useEffect ( ( ) => {
49+ if ( editableMdRef . current ) {
50+ editableMdRef . current . focus ( ) ;
51+ }
52+ } , [ editableMdRef , dirtyCell ] ) ;
53+
4754 useEffect ( ( ) => {
4855 if ( ! dirtyCell && containerCellRef . current ) {
4956 //TODO - this is a hack. find why is layout effect called twice
@@ -116,6 +123,7 @@ export default function DefaultCell(cellProperties: Cell) {
116123 onKeyDown = { handleKeyDown }
117124 onBlur = { handlerEditableOnBlur }
118125 className = { "data-input" }
126+ ref = { editableMdRef }
119127 />
120128 ) : (
121129 < span
You can’t perform that action at this time.
0 commit comments