From f0b9fcdefae389d2db6e1b2f9b4a5ef71a76ce5b Mon Sep 17 00:00:00 2001 From: Noah Mayerhofer Date: Tue, 8 Nov 2022 11:56:33 +0100 Subject: [PATCH 1/4] Add tabIndex to cypherEditor props --- .../cypher-editor/CypherEditor.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx b/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx index e1501cf06b0..7cd40ae6db2 100644 --- a/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx +++ b/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx @@ -65,6 +65,7 @@ type CypherEditorDefaultProps = { additionalCommands: Partial< Record > + tabIndex: number | undefined useDb: null | string value: string } @@ -86,6 +87,7 @@ const cypherEditorDefaultProps: CypherEditorDefaultProps = { } as any) ), additionalCommands: {}, + tabIndex: undefined, useDb: null, value: '' } @@ -347,7 +349,8 @@ export class CypherEditor extends React.Component< selectionHighlight: false, value: this.props.value, wordWrap: 'on', - wrappingStrategy: 'advanced' + wrappingStrategy: 'advanced', + tabIndex: this.props.tabIndex }) const { KeyCode, KeyMod } = monaco @@ -395,7 +398,7 @@ export class CypherEditor extends React.Component< return } - this?.editor?.addCommand(key, command) + this?.editor?.addCommand(key, command, '!editorTabMovesFocus') }) this.onContentUpdate() @@ -438,7 +441,8 @@ export class CypherEditor extends React.Component< } componentDidUpdate(prevProps: CypherEditorProps): void { - const { useDb, fontLigatures, enableMultiStatementMode } = this.props + const { useDb, fontLigatures, enableMultiStatementMode, tabIndex } = + this.props if (fontLigatures !== prevProps.fontLigatures) { this.editor?.updateOptions({ fontLigatures }) } @@ -454,6 +458,10 @@ export class CypherEditor extends React.Component< if (enableMultiStatementMode !== prevProps.enableMultiStatementMode) { this.onContentUpdate() } + + if (tabIndex !== prevProps.tabIndex) { + this.editor?.updateOptions({ tabIndex: this.props.tabIndex }) + } } componentWillUnmount = (): void => { From ef388e86efa97c85754611b7d83e5ac595fa8c4c Mon Sep 17 00:00:00 2001 From: Noah Mayerhofer Date: Tue, 8 Nov 2022 11:57:03 +0100 Subject: [PATCH 2/4] update arc version --- src/neo4j-arc/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neo4j-arc/package.json b/src/neo4j-arc/package.json index 5e078c1235e..f6d48f0a290 100644 --- a/src/neo4j-arc/package.json +++ b/src/neo4j-arc/package.json @@ -1,6 +1,6 @@ { "name": "@neo4j-devtools/arc", - "version": "0.0.38", + "version": "0.0.39", "main": "dist/neo4j-arc.js", "author": "Neo4j Inc.", "license": "GPL-3.0", From 05e6895eebf4fe73c00ce5fdf8ad6ae647218ff5 Mon Sep 17 00:00:00 2001 From: Noah Mayerhofer Date: Tue, 8 Nov 2022 11:59:44 +0100 Subject: [PATCH 3/4] remove argument --- .../cypher-language-support/cypher-editor/CypherEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx b/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx index 7cd40ae6db2..1c697dd7465 100644 --- a/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx +++ b/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx @@ -398,7 +398,7 @@ export class CypherEditor extends React.Component< return } - this?.editor?.addCommand(key, command, '!editorTabMovesFocus') + this?.editor?.addCommand(key, command) }) this.onContentUpdate() From fa0b602462dba6061686b09e09228cf7757c7bf3 Mon Sep 17 00:00:00 2001 From: Noah Mayerhofer Date: Tue, 8 Nov 2022 13:31:26 +0100 Subject: [PATCH 4/4] update after review --- .../cypher-language-support/cypher-editor/CypherEditor.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx b/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx index 1c697dd7465..9ef13615f50 100644 --- a/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx +++ b/src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx @@ -65,7 +65,7 @@ type CypherEditorDefaultProps = { additionalCommands: Partial< Record > - tabIndex: number | undefined + tabIndex?: number useDb: null | string value: string } @@ -87,7 +87,6 @@ const cypherEditorDefaultProps: CypherEditorDefaultProps = { } as any) ), additionalCommands: {}, - tabIndex: undefined, useDb: null, value: '' }