mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-05-06 08:26:44 -03:00
Fix ComfyUI shortcut leaks in LayerForge
Technical details: - skip LayerForge canvas and panel shortcuts when focus is inside editable controls - patch ComfyUI ChangeTracker undoRedo so Ctrl/Cmd+Z does not leak to graph history while LayerForge owns the shortcut context - stop clipboard copy/cut/paste events from editable LayerForge UI from bubbling into ComfyUI node clipboard handlers - route widget-root Ctrl/Cmd+Z, Ctrl/Cmd+Y, and Ctrl/Cmd+Shift+Z through LayerForge canvas undo and redo when the widget is active
This commit is contained in:
@@ -118,7 +118,19 @@ export class CanvasLayersPanel {
|
||||
this.setupControlButtons();
|
||||
this.setupMasterVisibilityToggle();
|
||||
// Dodaj listener dla klawiatury, aby usuwanie działało z panelu
|
||||
const isEditableTarget = (target) => {
|
||||
if (!(target instanceof HTMLElement)) {
|
||||
return false;
|
||||
}
|
||||
if (target.isContentEditable) {
|
||||
return true;
|
||||
}
|
||||
return !!target.closest('input, textarea, select, [contenteditable="true"]');
|
||||
};
|
||||
this.container.addEventListener('keydown', (e) => {
|
||||
if (isEditableTarget(e.target)) {
|
||||
return;
|
||||
}
|
||||
if (e.key === 'Delete' || e.key === 'Backspace') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user