Skip to content

<option> inside <optgroup> won't have selected attr in the SSR output #13486

Closed

Description

@n0099

Vue version

3.5.16

Link to minimal reproduction

https://play.vuejs.org/#__SSR__eNqFU01v2zAM/SuELt6A1OmWttsCd8A29LAdtmEbdqmKwnWYVK0sCRLtpjD830vJcdIvtDbgZ/I9U4+U1YkvzuVtg2IuilB55QgCUuM+S6NqZz1BBx6X0MPS2xoylmbSSFNZEwjoEv+XukE4jqI32eH+fvZ2JEutExk27Gm2fuXKJpC95xIMswEOBoh1GY4G+DDAxwE+MZzxosV08M/OOSCsnS4JOSoWqo1J4js9i4AaK4J2r7YL1MdSjH1IMQqpsI6UNdDGfJRgIKYjFNOBe6Bdeds40OVFKpiip9XGUFK7t7Sehc6GoC70ZozK7KYmxU49v8bbx2IpYD6ae0TsPhzftkYkdR08XLTvty6fNBYTqZdNioecZpfCYjpMtpjem7aYCAr8AyzVKr8K1vCP1UkDIEVla6c0+l9pDe5vDomJHHdtb36kHPkGJ2O+usTq+pn8VVjHnBS/PQb0LTe95aj0K+S9ivTJ35+45vctyTveaFa/QP7BYHWTtivJvjZmwbbv6ZLb7+l4KLP6F07WhCaMTUWjUdknvRR8ZL690PrO7iw/SN9J0/MUz1v0sSYPcJYf5u+ORH8HYd1CqA==

Steps to reproduce

  1. Switch to the SSR table on right pane
  2. Checkout the line 30:
          : _ssrLooseEqual($setup.theValue, "test"))) ? " selected" : ""
    and line 34 should be similar with 30 for adding selected attr, but it's just:
          _ssrRenderAttr("value", possibleValue)

What is expected?

  _ssrRenderList($setup.allValues, (possibleValue) => {
    _push(`<option${
      _ssrRenderAttr("value", possibleValue)
    }${
      (_ssrIncludeBooleanAttr((Array.isArray($setup.theValue))
        ? _ssrLooseContain($setup.theValue, possibleValue)
        : _ssrLooseEqual($setup.theValue, possibleValue))) ? " selected" : ""
    }>${
      _ssrInterpolate(possibleValue)
    }</option>`)

What is actually happening?

  _ssrRenderList($setup.allValues, (possibleValue) => {
    _push(`<option${
      _ssrRenderAttr("value", possibleValue)
    }>${
      _ssrInterpolate(possibleValue)
    }</option>`)
  })

System Info

No response

Any additional comments?

The reproduction is taken from #13436
PR #9442 seems fixed this in v3.3.6, so it should be an regression?

Activity

  1. added
    🔨 p3-minor-bug
    on Jun 17, 2025
  2. edison1105 commented on Jun 17, 2025

    @edison1105
    Member

    PR #9442 seems fixed this in v3.3.6, so it should be an regression?

    This belongs to the scenario #9442 that has not been fixed and cannot be regarded as regression

  3. added a commit that references this issue on Jun 18, 2025
    1552095
  4. locked and limited conversation to collaborators on Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugscope: ssr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions