Skip to content

Issue with interpolation binding inside HTML <option> element #737

Description

@glen-84

I'm submitting a bug report

  • Library Version:
    2.2.0

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    10.15.1

  • NPM Version:
    6.4.1

  • JSPM OR Webpack AND Version
    any

  • Browser:
    all

  • Language:
    all

Current behavior:
Using an interpolation binding inside an HTML <option> breaks the bound value of the select element.

f.e.

  <select value.bind="selectedProduct.id">
    <option model.bind="null">${theDefault}</option>
    <option repeat.for="product of products" model.bind="product.id">
      ${product.name}
    </option>
  </select>

Remove ${theDefault} here (replace it with a static string), and everything works as expected.

Alternatively, changing void to await in the VM activate method works around the issue.

Expected/desired behavior:
(The GistRun example is outdated, see jdanyow/rjs-bundle#5)

https://codesandbox.io/s/nwvzx649yl

  • What is the expected behavior?

CPU should be selected.

  • What is the motivation / use case for changing the behavior?
  1. This worked in previous versions.
  2. We need to use a dynamic option label (we're actually using a computed property)
  3. We don't want to await loading of the items (it will delay rendering of the view)

@bigopon Could this be related to #677?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions