Skip to content

Commit

Permalink
#2460 - structure on canvas becomes undefined when atom is hovered an…
Browse files Browse the repository at this point in the history
…d functional group selected using hotkey
  • Loading branch information
Maxim Novikov authored and Maxim Novikov committed Apr 21, 2023
1 parent 0876d1e commit 64a89c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ketcher-react/src/script/ui/action/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const templateLib = {
'template-lib': {
shortcut: 'Shift+t',
title: 'Custom Templates',
action: { dialog: 'templates', prop: { tab: null } },
action: { dialog: 'templates', prop: { tab: 0 } },
selected: (editor) => editor._tool.mode === 'classic',
disabled: (editor, server, options) => !options.app.templates,
hidden: (options) => isHidden(options, 'template-lib')
Expand Down
6 changes: 5 additions & 1 deletion packages/ketcher-react/src/script/ui/state/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ function keyHandle(dispatch, state, hotKeys, event) {
// check if atom is currently hovered over
// in this case we do not want to activate the corresponding tool
// and just insert the atom directly
if (hoveredItem && newAction.tool !== 'select') {
if (
hoveredItem &&
newAction.tool !== 'select' &&
newAction.dialog !== 'templates'
) {
newAction = getCurrentAction(group[index]) || newAction
handleHotkeyOverItem({
hoveredItem,
Expand Down

0 comments on commit 64a89c2

Please sign in to comment.