Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6dba0e4

Browse files
authored
Another fix for focus on add (#7883)
1 parent e1a9b0e commit 6dba0e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datascience-ui/native-editor/nativeEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ export class NativeEditor extends React.Component<INativeEditorProps, IMainState
176176
const newCell = this.stateController.addNewCell();
177177
this.stateController.sendCommand(NativeCommandType.AddToEnd, 'mouse');
178178
if (newCell) {
179-
this.stateController.selectCell(newCell.cell.id, newCell.cell.id);
179+
// Has to be async because the click will change the focus on mouse up
180+
setTimeout(() => this.focusCell(newCell.cell.id, true), 0);
180181
}
181182
};
182183
const runAll = () => {

0 commit comments

Comments
 (0)