Giter VIP home page Giter VIP logo

Comments (11)

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024 1

Aurelia treats native select in a special way, unlike non-native MDC widget. I'll see if I can do anything about it

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024

Version 1.1.6 does not need explicit mdc-list element. Please remove that or upgrade to v2 of the bridge.

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024

I cannot reproduce the issue in the gist
https://gist.dumber.app/?gist=4fb62077f5564275f96253b8e708314a

from aurelia-mdc-web.

mreiche avatar mreiche commented on June 6, 2024

It works when _availableStatuses is already initialized. But not when its lazy loaded like...

const loadAsync = new Promise((resolve, reject) => {
    window.setTimeout(() => {
        resolve( ["Katze", "passed", "Maus"]);
        }, 2000)
});

loadAsync.then((value:string[]) => {
    this._availableStatuses = value;
});

Unfortunately, I cannot edit your Gist because of rate limit hit.

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024

You can only set the value after the select is populated with options, otherwise it cannot find the corresponding list item.

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024

I've updated the gist for async load, no issue

from aurelia-mdc-web.

mreiche avatar mreiche commented on June 6, 2024

But shouldn't it work like that? https://gist.dumber.app/?gist=8204b93b878e0f8ad4f027ace68d06d9

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024

This cannot work. After activate the widget's value is set but there are no items to match that value with.

from aurelia-mdc-web.

mreiche avatar mreiche commented on June 6, 2024

But this is the way I used to implement that the Aurelia way using regular select elements.

I've updated https://gist.dumber.app/?gist=8204b93b878e0f8ad4f027ace68d06d9 by

<select value.bind="_selectedStatus">
     <option repeat.for="status of _availableStatuses" value.bind="status">${status}</option>
</select>

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on June 6, 2024

Hopefully this will be sufficient. I've modified the binding observer to monitor mdc-list-item mutations.
It will wait for options before trying to pass the current value to the element.
But once options has been set at least once any subsequent options changes will pull the value from the element, possibly overwriting the current value if it is not present in the current list.

from aurelia-mdc-web.

mreiche avatar mreiche commented on June 6, 2024

But once options has been set at least once any subsequent options changes will pull the value from the element, possibly overwriting the current value if it is not present in the current list.

Doesn't sound wrong to me.

Thanks. I really apprecriate your passion.

from aurelia-mdc-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.