Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG]: Parent node extent not enforced when used with Node Resizer #1539

Open
1 task done
yczkhx-ths opened this issue Jul 12, 2024 · 2 comments
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@yczkhx-ths
Copy link

yczkhx-ths commented Jul 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues and this is a new bug.

Current Behavior

one parent node contanis a child node(extent: 'parent'). when shrink the parent, it can not contains the child, and when drag the child, it flicker into the parent; it seems like a bug; below are the example:
image
and drag the child, it becomes into this in one second
image

Expected Behavior

it seems resize should consider child nodes inside, the min-width and min-height should contains all children;

Steps To Reproduce

code with 'https://vueflow.dev/examples/nodes/node-resizer.html'

<script setup>
import { ref } from 'vue'
import { VueFlow } from '@vue-flow/core'
import ResizableNode from './ResizableNode.vue'

const nodes = ref([
  {
    id: '1',
    type: 'resizable',
    data: { label: 'NodeResizer' },
    position: { x: 0, y: 0 },
    style: { background: '#fff', border: '2px solid black' },
  },
  {
    id: '2',
    type: 'input',
    data: { label: 'NodeResizer' },
    position: { x: 0, y: 0 },
    style: { background: '#fff', border: '2px solid black' },
    parentNode: '1',
    extent: 'parent'
    
  },
])
</script>

<template>
  <VueFlow :nodes="nodes" fit-view-on-init>
    <template #node-resizable="resizableNodeProps">
      <ResizableNode :data="resizableNodeProps.data" />
    </template>
  </VueFlow>
</template>

Relevant log output

No response

Anything else?

No response

@yczkhx-ths yczkhx-ths added bug Something isn't working triage Awaiting triage labels Jul 12, 2024
@bcakmakoglu bcakmakoglu changed the title 🐛 [BUG]: <Parent Node with Resizer will not Cover the Children Nodes When Shrink> 🐛 [BUG]: Parent node extent not enforced when used with Node Resizer Jul 13, 2024
@bcakmakoglu
Copy link
Owner

Thanks for the report, I'll check this and address the issue in the next patch :)

@yczkhx-ths
Copy link
Author

and there is a temporary solution:
use getRectOfNodes to get Rect of all children,and pass it to props<min-wdith,min-height> in NodeResizer

@bcakmakoglu bcakmakoglu removed the triage Awaiting triage label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants