GithubHelp home page GithubHelp logo

Drop-in replacement for <select> about virtual-select HOT 6 CLOSED

sa-si-dev avatar sa-si-dev commented on July 19, 2024
Drop-in replacement for .value (already done)
  • .name
  • .disabled
  • .form (for use as event.target.form where target is virtual-select. Not necessary but desirable)
  • .multiple (already done)
  • .required
  • .options
  • .length
  • .selectedOptions (already done as method getSelectedOptions() but not as property)
  • .autofocus
  • @sa-si-dev

    from virtual-select.

    sa-si-dev avatar sa-si-dev commented on July 19, 2024

    I would like to get the following parameters (passed during initialization) back in the form of node propertys (as in a regular <select> node):

    • .value (already done)
    • .name
    • .disabled
    • .form (for use as event.target.form where target is virtual-select. Not necessary but desirable)
    • .multiple (already done)
    • .required
    • .options
    • .length
    • .selectedOptions (already done as method getSelectedOptions() but not as property)
    • .autofocus

    @sa-si-dev

    @bes-internal I will implement this changes in the future release.

    from virtual-select.

    sa-si-dev avatar sa-si-dev commented on July 19, 2024

    The idea is to drop-in replace regular <select> with virtual-select. Including for backward compatibility.

    Need to deepen the idea of using data-* attributes on node. There are limitations as indicated in the documentation. Following properties are not allowed to use as attribute:

    1. options (need to read the provided <option> inside <select>)
    2. disabledOptions (need to read disabled attr on <option>)
    3. selectedValue (need to read selected attr on <option>)
    4. onServerSearch, labelRenderer (I do not know)

    For all of the above, there should be a warning in the documentation that this method is only for backward compatibility and slow on a lot of options. But with a small number of options, this is not a problem at all.

    Now initialization on the select, as expected, does not give a result because all the work happens inside the element. Here we may need to add the replace property or unconditionally replace depending on Element.tagName.

    P.S. It will be great. Magic transformation of all select on page into a new-era-select. Yes, this is something from a world where the idea of everything at the front has not yet won, but that is why this project was also created, right?

    @bes-internal This feature is available in the release v1.0.22 (more details)

    from virtual-select.

    sa-si-dev avatar sa-si-dev commented on July 19, 2024

    I would like to get the following parameters (passed during initialization) back in the form of node propertys (as in a regular <select> node):

    • .value (already done)
    • .name
    • .disabled
    • .form (for use as event.target.form where target is virtual-select. Not necessary but desirable)
    • .multiple (already done)
    • .required
    • .options
    • .length
    • .selectedOptions (already done as method getSelectedOptions() but not as property)
    • .autofocus

    @sa-si-dev

    @bes-internal This feature is available in the release v1.0.22

    .selectedOptions - This prop is not implemented as we already have getSelectedOptions() method and it might affect the performance.

    from virtual-select.

    bes-internal avatar bes-internal commented on July 19, 2024

    Great. Thanks!

    .selectedOptions

    the goal is for third-party software to work with this element as with a usual <select>

    from virtual-select.

    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.