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

DOM would never be removed with vue transition #14

Closed
varHarrie opened this issue Aug 26, 2016 · 1 comment
Closed

DOM would never be removed with vue transition #14

varHarrie opened this issue Aug 26, 2016 · 1 comment

Comments

@varHarrie
Copy link

When I drag into another container, the HTML element will be added class scale-leave but never be removed.

<template>
  <div class="page-test">
    <div v-for="c in categories">
      <p>{{c.name}}</p>
      <ul v-dragula="c.list">
        <li v-for="item in c.list" transition="scale">{{item}}</li>
      </ul>
    </div>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        categories: [{
          _id: '0000000001',
          name: 'in progress',
          list: ['111', '222']
        }, {
          _id: '0000000002',
          name: 'plan',
          list: ['333']
        }]
      }
    }
  }
</script>

<style lang="stylus">
  .page-test
    .scale-transition
      overflow: hidden
      height: 38px
      transition: height .2s
    .scale-enter,.scale-leave
      height: 0
</style>
Astray-git added a commit that referenced this issue Oct 9, 2016
fix #14 wait for transition before remove model
@varHarrie
Copy link
Author

varHarrie commented Oct 14, 2016

@Astray-git Still have problems, but not with vue transition.

vue-dragula@1.2.0

At the same conditionm I just replace li element with a custom component. When I drag the component into another container, the source component still exists.

<template>
  <div class="page-test">
    <div v-for="category in categories">
      <h3>{{category.name}}</h3>
      <div v-dragula="category.list">
        <!-- work fine -->
        <!-- <div v-for="item in category.list">{{item.name}}</div> -->

        <!-- buggy -->
        <example v-for="item in category.list" :item="item"></example>
      </div>
    </div>
  </div>
</template>

<script>
  import Example from './Example.vue'
  export default {
    components: {Example},
    data () {
      return {
        categories: [{
          name: 'in progress',
          list: [{name: '1'}, {name: '2'}]
        }, {
          name: 'plan',
          list: [{name: '3'}]
        }]
      }
    }
  }
</script>

Example.vue

<template>
  <div>{{item.name}}</div>
</template>

<script>
export default {
  props: {
    item: {type: Object}
  }
}
</script>

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

No branches or pull requests

1 participant