Skip to content

Commit 3f06af6

Browse files
authored
Add tab index to cypher editor (#1847)
* Add tabIndex to cypherEditor props * update arc version * remove argument * update after review
1 parent b82c3ba commit 3f06af6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/neo4j-arc/cypher-language-support/cypher-editor/CypherEditor.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type CypherEditorDefaultProps = {
6565
additionalCommands: Partial<
6666
Record<monaco.KeyCode, monaco.editor.ICommandHandler>
6767
>
68+
tabIndex?: number
6869
useDb: null | string
6970
value: string
7071
}
@@ -347,7 +348,8 @@ export class CypherEditor extends React.Component<
347348
selectionHighlight: false,
348349
value: this.props.value,
349350
wordWrap: 'on',
350-
wrappingStrategy: 'advanced'
351+
wrappingStrategy: 'advanced',
352+
tabIndex: this.props.tabIndex
351353
})
352354

353355
const { KeyCode, KeyMod } = monaco
@@ -438,7 +440,8 @@ export class CypherEditor extends React.Component<
438440
}
439441

440442
componentDidUpdate(prevProps: CypherEditorProps): void {
441-
const { useDb, fontLigatures, enableMultiStatementMode } = this.props
443+
const { useDb, fontLigatures, enableMultiStatementMode, tabIndex } =
444+
this.props
442445
if (fontLigatures !== prevProps.fontLigatures) {
443446
this.editor?.updateOptions({ fontLigatures })
444447
}
@@ -454,6 +457,10 @@ export class CypherEditor extends React.Component<
454457
if (enableMultiStatementMode !== prevProps.enableMultiStatementMode) {
455458
this.onContentUpdate()
456459
}
460+
461+
if (tabIndex !== prevProps.tabIndex) {
462+
this.editor?.updateOptions({ tabIndex: this.props.tabIndex })
463+
}
457464
}
458465

459466
componentWillUnmount = (): void => {

src/neo4j-arc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neo4j-devtools/arc",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"main": "dist/neo4j-arc.js",
55
"author": "Neo4j Inc.",
66
"license": "GPL-3.0",

0 commit comments

Comments
 (0)