Skip to content

Commit a84eac0

Browse files
committed
* #RI-6581 - Empty delimiter can be applied
* #RI-6582 - The same delimiter can be applied multiple times
1 parent 8b64f3b commit a84eac0

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export enum EventKeys {
2+
ENTER = 'Enter',
3+
SPACE = ' ',
4+
ESCAPE = 'Escape',
5+
TAB = 'Tab',
6+
}

src/webviews/src/constants/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * from './core/apiErrors'
44
export * from './core/app'
55
export * from './core/storage'
66
export * from './core/commands'
7+
export * from './core/eventKeys'
78
export * from './connections/databases'
89
export * from './keys/types'
910
export * from './keys/tree'

src/webviews/src/modules/settings/Settings.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { VscCheck } from 'react-icons/vsc'
77

88
import { Separator } from 'uiSrc/ui'
99
import { ConsentsPrivacy, MultiSelect, MultiSelectOption } from 'uiSrc/components'
10-
import { DEFAULT_DELIMITER, VscodeMessageAction } from 'uiSrc/constants'
10+
import { DEFAULT_DELIMITER, EventKeys, VscodeMessageAction } from 'uiSrc/constants'
1111
import { vscodeApi } from 'uiSrc/services'
1212
import { useAppInfoStore } from 'uiSrc/store/hooks/use-app-info-store/useAppInfoStore'
1313
import { TelemetryEvent, arrayToMultiSelect, multiSelectToArray, sendEventTelemetry } from 'uiSrc/utils'
@@ -58,8 +58,8 @@ export const Settings = () => {
5858

5959
// eslint-disable-next-line default-case
6060
switch (event.key) {
61-
case 'Enter':
62-
case ' ':
61+
case EventKeys.ENTER:
62+
case EventKeys.SPACE:
6363
if (delimiters.find(({ value }) => value === inputValue)) {
6464
return
6565
}

0 commit comments

Comments
 (0)