ToolJet/frontend/src/_hooks/useKeyHooks.js
Navaneeth Pk e8ca5cbc73
Ability to select multiple widgets from canvas and change their position (#2979)
* Better canvas

* fixes sets the active node to the selected widget on the editor

* removing selectedComponent and fixing currentTab msg alignment for inspector

* useKeyHooks custom hotkey hook

* handles escape key on editor

* handles delete for multiple widgets

* removes unwanted comments

* fixes: all the widgets are deleted at once, in a single action

* hide delete button from widegt config handler when multiple components are selected

* fixes delete button width for long chars

* Revert "fixes delete button width for long chars"

This reverts commit 79dadfa7d3.

* fixes display config handler for selected widgets on layout/container widgets

* subcontainer layer dnd improvement for multi-widget

Co-authored-by: arpitnath <[email protected]>
2022-05-11 14:43:13 +05:30

9 lines
221 B
JavaScript

import { useHotkeys } from 'react-hotkeys-hook';
const useKeyHooks = (hotkeys = [], callback) =>
useHotkeys(hotkeys.toString(), (e) => {
e.preventDefault();
callback(e.code);
});
export default useKeyHooks;