Choices-js / Choices

A vanilla JS customisable select box/text input plugin ⚡️
https://choices-js.github.io/Choices/
MIT License
6.06k stars 598 forks source link

misleading documentation for getValue #1107

Open curious-broccoli opened 1 year ago

curious-broccoli commented 1 year ago

In the example for getValue() it shows a Choices instance being initialized from a HTML element. I think this is misleading because it makes the user think that they can access the values with getValue() by simply initializing using an HTML element. But if you try to initialize on an element that was already initialized it won't work. And if you make a completely new Choices instance there will only be the default values.

I think it would be better if the example code showed using getValue() on a Choices instance that was saved in a variable and/or explains that to get the values from an existing element you will have to save its Choices instance in a variable that you can access in your code later – multiple issues were opened because users did not understand this.

(This problem might apply to other functions as well)