Selectively choose which dimensions to enable resizing #1372
shaunabanana
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
You can build your own custom resizer using <script setup>
import { Handle, Position } from '@vue-flow/core'
import { NodeResizeControl, ResizeControlVariant } from '@vue-flow/node-resizer';
defineProps(['id', 'label'])
</script>
<template>
<NodeResizeControl :node-id="id" :variant="ResizeControlVariant.Line" position="left" />
<NodeResizeControl :node-id="id" :variant="ResizeControlVariant.Line" position="right" />
<Handle type="target" :position="Position.Left" />
<div style="padding: 10px">{{ label }}</div>
<Handle type="source" :position="Position.Right" />
</template> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be very useful if the NodeResizer allows resizing only horizontally or vertically, while allowing the other axis to grow based on content.
I understand that #1234 already mentioned this, but seeing that it was posted in the Q&A section and has gone unanswered so far, I hope it is okay to post this idea here as a feature request with some additional thoughts.
One case where this would be helpful is if the node contains text that needs to be shown in full. In this case, resizing on the x-axis would wrap the text, thus changing its height. The current behaviour of core VueFlow when not using NodeResizer is already the desired behaviour, with connection handles correctly moving in response as well.
Another related feature would be selectively showing/hiding the control lines/handles. This would be useful when only one axis is resizeable.
Beta Was this translation helpful? Give feedback.
All reactions