SortableJS / vue.draggable.next

Vue 3 compatible drag-and-drop component based on Sortable.js
https://sortablejs.github.io/vue.draggable.next/#/simple
MIT License
3.91k stars 531 forks source link

Child input component lost focus when emit moduleValue #103

Open srocerer opened 2 years ago

srocerer commented 2 years ago

Input works fine if I do not use child component

Child input component:

<Item-input v-model="element.name"></Item-input>
<template>
    <input class="input" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" ref="input">
</template>

<script>
import { defineComponent } from 'vue'

export default defineComponent({
    props: ['modelValue'],

    emits: ['update:modelValue'],

    methods: {
        focus() {
            this.$refs.input.focus()
        }
    }
})
</script>
BackThePortal commented 1 year ago

See #96