Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

adding an object the group via v-for after the group has moved #124

Open
skinnyjames opened this issue Sep 7, 2020 · 1 comment · May be fixed by #125
Open

adding an object the group via v-for after the group has moved #124

skinnyjames opened this issue Sep 7, 2020 · 1 comment · May be fixed by #125

Comments

@skinnyjames
Copy link

skinnyjames commented Sep 7, 2020

Heya! thanks for making this one.

i have a component that get's fed in with data that looks like this

entities = { id: 'uuuid', columns: [ { name: 'something' }] }
<fabric-group
    ref="tableGroup"
    :id="entity.id">
    <fabric-rectangle
      :stroke="'#000'"
      :strokeWidth="1"
      ref="lines"
      :selectable="true"
      v-for="(column, idx) in entity.columns"
      :id="`entity-${entity.id}-path-${idx}`"
      :key="`entity-${entity.id}-path-${idx}`"
      :width="200"
      :top="(50 * (idx + 1))"
      :height="50"
    />
</fabric-group>

In the calling component, I'm adding objects to the entity.columns array
It renders them in the correct position when it initially renders
if i don't move the group, adding more columns will render more rectangles in the correct position,
but after moving the group, when adding objects, it renders them in the original group position, and not in the new group position.

here's a demo: https://codesandbox.io/s/stickman-forked-0lk25?file=/src/App.vue

Any ideas on this?

@skinnyjames skinnyjames linked a pull request Sep 7, 2020 that will close this issue
@bensladden
Copy link
Owner

Thanks for your contribution, Ill have a look asap.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants