GithubHelp home page GithubHelp logo

Comments (4)

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

@gowravshekar thank you for letting me know these issue.

I will check them and fix in the future release.

from virtual-select.

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

@sa-si-dev, Great work with the library. I have been testing the library with different combinations and made below observations.

  1. allowNewOption and selectedValue doesn't work together.

If a new value is added with the above combination and upon editing the form with selectedValue, the select box shows empty.

  1. allowNewOption and onServerSearch combination.

With the above combination, is there a way to allow new option. Adding a new option manually with searchValue doesn't let the user know that it's a new option.

  1. Value can be only of primitive type because of valueKey design.

valueKey should take a function which enable developers to pick an object as value. This will be useful especially with allowNewOption to distinguish between a new option selected by user(which will be primitive) and value selected by pre-defined option(which will be object).

@gowravshekar

Item 1. - I couldn't get the issue you are trying to convey. Could you please give some more details.

Item 3. I don't think it is needed to support function as a valueKey. For your sample scenario, we could use getNewValue() method to get selected value which is added as new option.

from virtual-select.

gowrav-scienaptic avatar gowrav-scienaptic commented on July 19, 2024

Item1:

https://sa-si-dev.github.io/virtual-select/#/examples?id=preselect-value

If the selectedValue is not part of the default options set as we had allowNewOption = true, the new option should be automatically added and displayed in the input on editing the form.

If default options are - Option 1, Option 2, Option 3 and selected value is Option 4 and allowNewOption = true, then input should show Option 4.

Item3:

What happens with a multi-select, when the new value is added and removed. It's very difficult to keep track of items selected by default options and added by users. One more use case is when the selected value needs to be an object instead of a scalar like in this example.

from virtual-select.

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

@gowravshekar above issues have been fixed in the release v1.0.9.

For item 3, you could use getSelectedOptions() method.

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.