mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(editor): Restore valid drag state when NDV is closed via ESC while dragging (#16758)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DraggableMode, XYPosition } from '@/Interface';
|
||||
import { isPresent } from '@/utils/typesUtils';
|
||||
import { type StyleValue, computed, ref } from 'vue';
|
||||
import { type StyleValue, computed, onBeforeUnmount, ref } from 'vue';
|
||||
|
||||
type Props = {
|
||||
type: DraggableMode;
|
||||
@@ -113,8 +113,14 @@ const onDragEnd = () => {
|
||||
if (draggingElement.value) emit('dragend', draggingElement.value);
|
||||
isDragging.value = false;
|
||||
draggingElement.value = undefined;
|
||||
}, 0);
|
||||
});
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (draggingElement.value) {
|
||||
emit('dragend', draggingElement.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user