Skip to content

Commit 3443c8f

Browse files
LittleSoundDrJKL
andauthored
fix: unintended text selection when resizing the splitter (#7187)
┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7187-fix-unintended-text-selection-when-resizing-the-splitter-2c06d73d365081b38644daa1f07fa1fb) by [Unito](https://www.unito.io) --------- Co-authored-by: DrJKL <[email protected]>
1 parent 3c8def7 commit 3443c8f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/LiteGraphCanvasSplitterOverlay.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
:pt:gutter="getSplitterGutterClasses"
2020
:state-key="sidebarStateKey"
2121
state-storage="local"
22+
@resizestart="onResizestart"
2223
>
2324
<SplitterPanel
2425
v-if="sidebarLocation === 'left'"
@@ -50,6 +51,7 @@
5051
"
5152
state-key="bottom-panel-splitter"
5253
state-storage="local"
54+
@resizestart="onResizestart"
5355
>
5456
<SplitterPanel class="graph-canvas-panel relative">
5557
<slot name="graph-canvas-panel" />
@@ -97,6 +99,7 @@
9799

98100
<script setup lang="ts">
99101
import Splitter from 'primevue/splitter'
102+
import type { SplitterResizeStartEvent } from 'primevue/splitter'
100103
import SplitterPanel from 'primevue/splitterpanel'
101104
import { computed } from 'vue'
102105
@@ -148,6 +151,13 @@ const getSplitterGutterClasses = computed(() => {
148151
// Empty string - let individual gutter styles handle visibility
149152
return ''
150153
})
154+
155+
/**
156+
* Avoid triggering default behaviors during drag-and-drop, such as text selection.
157+
*/
158+
function onResizestart({ originalEvent: event }: SplitterResizeStartEvent) {
159+
event.preventDefault()
160+
}
151161
</script>
152162

153163
<style scoped>

0 commit comments

Comments
 (0)