Closed VanTanev closed 5 years ago
As #257 pointed out, we do not have a good list for chosen options right now.
Chosen doesn't have a good way to programmatically get the options. There is no public method for getting the defaults, but instead defaults are applied as instance variables on init.
So... Maybe scraping the options page is good enough:
Array.from( document.querySelectorAll('table:first-of-type tr td:first-of-type') ) .map(node => node.textContent) .map(option => option.replace(/_(\w)/g, (_, letter) => letter.toUpperCase()))
produces
[ "allowSingleDeselect", "disableSearch", "disableSearchThreshold", "enableSplitWordSearch", "inheritSelectClasses", "maxSelectedOptions", "noResultsText", "placeholderTextMultiple", "placeholderTextSingle", "searchContains", "groupSearch", "singleBackstrokeDelete", "width", "displayDisabledOptions", "displaySelectedOptions", "includeGroupLabelInSelected", "maxShownResults", "caseSensitiveSearch", "hideResultsOnSelect", "rtl" ]
The question is, should we keep the options that used to exist with some older version of Chosen? How do we even verify what those were? @leocaseiro do you have any input?
If the scraping works without the previous options, I think it's good to remove them.
As #257 pointed out, we do not have a good list for chosen options right now.
Chosen doesn't have a good way to programmatically get the options. There is no public method for getting the defaults, but instead defaults are applied as instance variables on init.
So... Maybe scraping the options page is good enough:
produces
The question is, should we keep the options that used to exist with some older version of Chosen? How do we even verify what those were? @leocaseiro do you have any input?