Skip to content

select v-model does not set 'selected' attribute on option with v-for directive using SSR #12395

Closed
@tirojal

Description

@tirojal

Vue version

3.5.12

Link to minimal reproduction

https://play.vuejs.org/#__SSR__eNqFUstOwzAQ/BXLl4BUWsSbKiAB4gAHQIC4YA4l3Ra3jm3Zm1AU5d/Z2E0fCEoiZeKdyWbG64pfWNstC+B9nvrMSYvMAxb2XGiZW+OQVczBiNVs5EzOEpImQgudGe2R4Qe8DFQB7KwRbSWHu7vJdksOlAqkn7OvyeyfK+mwZI9aEOxHOIjQ9CU4inAc4STCKcEb/TTtRf/knBYIuVUDBFqlQ1k2RaQ7PFMPCjJk5U5uhqDOBG9zCN4KMTUWpaFWcSmw3BkZR1prvJfvah5c6mVOwZfq/hS+forX+LKp/K1Y+BBYVWz9n3W9MNmLLudq2oKQLCzTXsyd9lb2gnc4ehrPSI67E280jb0SmjHBM5NbqcDdh4aUpc8C03CU0Hzehhq6AjptPfuAbPpLfeJnTU3wBwceXEm5FhwO3Bgw0tdPdzCj9wVJ8ygUqTeQj+CNKsJoguyy0EOyvaILbm/C4ZV6/OyvZwjat6Eao42yDnrB6UBfbYi+tLvfPQjfCV3z+hu9thho

Steps to reproduce

Click on refresh button.

What is expected?

option with value === '500' should have selected attribute on SSR

What is actually happening?

option receives selected attribute only on CSR, you may see 'xxxxxxxx' option is selected for a moment after pressing 'refresh'

System Info

No response

Any additional comments?

Found similar issue, but in my case it happens only when option have v-for attribute
#5339

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: ssr

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions