mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +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">
|
<script setup lang="ts">
|
||||||
import type { DraggableMode, XYPosition } from '@/Interface';
|
import type { DraggableMode, XYPosition } from '@/Interface';
|
||||||
import { isPresent } from '@/utils/typesUtils';
|
import { isPresent } from '@/utils/typesUtils';
|
||||||
import { type StyleValue, computed, ref } from 'vue';
|
import { type StyleValue, computed, onBeforeUnmount, ref } from 'vue';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
type: DraggableMode;
|
type: DraggableMode;
|
||||||
@@ -113,8 +113,14 @@ const onDragEnd = () => {
|
|||||||
if (draggingElement.value) emit('dragend', draggingElement.value);
|
if (draggingElement.value) emit('dragend', draggingElement.value);
|
||||||
isDragging.value = false;
|
isDragging.value = false;
|
||||||
draggingElement.value = undefined;
|
draggingElement.value = undefined;
|
||||||
}, 0);
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
if (draggingElement.value) {
|
||||||
|
emit('dragend', draggingElement.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user