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> {
281281
282282 // tslint:disable-next-line: cyclomatic-complexity max-func-body-length
283283 private keyDownInput = ( cellId : string , e : IKeyboardEvent ) => {
284+ if ( ! this . isNotebookTrusted ( ) && ! isCellNavigationKeyboardEvent ( e ) ) {
285+ return ;
286+ }
284287 const isFocusedWhenNotSuggesting = this . isFocused ( ) && e . editorInfo && ! e . editorInfo . isSuggesting ;
285288 switch ( e . code ) {
286289 case 'ArrowUp' :
@@ -886,3 +889,15 @@ export class NativeCell extends React.Component<INativeCellProps> {
886889export function getConnectedNativeCell ( ) {
887890 return connect ( null , actionCreators ) ( NativeCell ) ;
888891}
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