Skip to content

<select> doesn't select correct option after render #6882

@fergusean

Description

@fergusean

Version

2.5.2

Reproduction link

https://jsfiddle.net/fergusean/a001nzw5/2/

Steps to reproduce

Nothing. Auto-fake AJAX data load.

What is expected?

The select should render, and the option whose value is == the value of the model bound to the select should be selected.

What is actually happening?

The first option in the select is active, until either a call to $forceUpdate, or another model is changed (click into the text field and type a letter). Then, suddenly, the correct value is selected in the dropdown.


This used to work in Vue 1. I upgraded and then discovered this. I'm working around it for now with a this.$nextTick(() => $this.forceUpdate());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions