Skip to content

select gets reverted to default value on move #229

@robertplanetweb

Description

@robertplanetweb

select gets reverted to default value on move but gets restored on drop.
this is only a visual bug, it doesn't affect the v-model.

here's a workaround:

<script>
....
methods: {
    setSelected(e) {
        setTimeout(() => {
            for ( let option of e.target.querySelectorAll(`option`) ) {
                option.value == this.something ? option.setAttribute('selected', 'selected') : option.removeAttribute('selected');
            }
        }, 10);
    },
},
mounted() {
  this.setSelected({ target: this.$refs.select });
}
.....
</script>

<select v-model="something" ref="select">
     <option value="first_value">First Value</option>
     <option value="second_value">Second Value</option>
</select>

PS: awesome plugin, thanks @kutlugsahin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions