Skip to content

Commit

Permalink
#2490 - When atoms are selected, pressing atoms hotkey opens a modal …
Browse files Browse the repository at this point in the history
…window instead of an instant replacement

* Remove opening Label Editor when pressing hot keys
  • Loading branch information
gairon committed May 11, 2023
1 parent dd2e2a0 commit 5b7c3a7
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/ketcher-react/src/script/ui/state/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { load, onAction, removeStructAction } from './shared'

import actions from '../action'
import keyNorm from '../data/convert/keynorm'
import { openDialog } from './modal'
import { isIE } from 'react-device-detect'
import { handleHotkeyOverItem } from './handleHotkeysOverItem'

Expand Down Expand Up @@ -57,18 +56,10 @@ function keyHandle(dispatch, state, hotKeys, event) {
const actionTool = actionState.activeTool

const key = keyNorm(event)
const atomsSelected = editor.selection() && editor.selection().atoms

let group: any = null

if (key && key.length === 1 && atomsSelected && key.match(/\w/)) {
openDialog(dispatch, 'labelEdit', { letter: key })
.then((res) => {
dispatch(onAction({ tool: 'atom', opts: res }))
})
.catch(() => null)
event.preventDefault()
} else if (key && key.length === 1 && key.match('/')) {
if (key && key.length === 1 && key.match('/')) {
const hotkeyDialogTypes = {
atoms: actions['atom-props'].action,
bonds: actions['bond-props'].action
Expand Down

0 comments on commit 5b7c3a7

Please sign in to comment.