mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
Fixed delete confirmation popping up while clicking backspace on canvas (#2504)
This commit is contained in:
parent
44ff38cc10
commit
ed75923193
1 changed files with 8 additions and 1 deletions
|
|
@ -45,6 +45,13 @@ export const HotkeyProvider = ({ children, mode, currentLayout, canvasMaxWidth }
|
|||
}
|
||||
};
|
||||
|
||||
const deleteComponents = () => {
|
||||
const selectedComponents = getSelectedComponents();
|
||||
if (selectedComponents.length > 0) {
|
||||
setWidgetDeleteConfirmation(true);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const handleClick = (e) => {
|
||||
const modalContainer = document.getElementById('modal-container');
|
||||
|
|
@ -91,7 +98,7 @@ export const HotkeyProvider = ({ children, mode, currentLayout, canvasMaxWidth }
|
|||
handleEscapeKeyPress(); // clears the selected components
|
||||
break;
|
||||
case 'Backspace':
|
||||
setWidgetDeleteConfirmation(true); // Delete opration -> First asks for a Confirmation
|
||||
deleteComponents(); // Delete opration -> First asks for a Confirmation
|
||||
break;
|
||||
case 'KeyD':
|
||||
copyComponents({ isCloning: true }); // Clone/Duplicate operation
|
||||
|
|
|
|||
Loading…
Reference in a new issue