File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/datascience-ui/native-editor Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,9 @@ export class NativeCell extends React.Component<INativeCellProps> {
281
281
282
282
// tslint:disable-next-line: cyclomatic-complexity max-func-body-length
283
283
private keyDownInput = ( cellId : string , e : IKeyboardEvent ) => {
284
+ if ( ! this . isNotebookTrusted ( ) && ! isCellNavigationKeyboardEvent ( e ) ) {
285
+ return ;
286
+ }
284
287
const isFocusedWhenNotSuggesting = this . isFocused ( ) && e . editorInfo && ! e . editorInfo . isSuggesting ;
285
288
switch ( e . code ) {
286
289
case 'ArrowUp' :
@@ -886,3 +889,15 @@ export class NativeCell extends React.Component<INativeCellProps> {
886
889
export function getConnectedNativeCell ( ) {
887
890
return connect ( null , actionCreators ) ( NativeCell ) ;
888
891
}
892
+
893
+ function isCellNavigationKeyboardEvent ( e : IKeyboardEvent ) {
894
+ return (
895
+ e . code === 'Enter' ||
896
+ e . code === 'NumpadEnter' ||
897
+ e . code === 'ArrowUp' ||
898
+ e . code === 'k' ||
899
+ e . code === 'ArrowDown' ||
900
+ e . code === 'j' ||
901
+ e . code === 'Escape'
902
+ ) ;
903
+ }
You can’t perform that action at this time.
0 commit comments