Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim newlines from options #1142

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ tests/results
coverage
cypress/videos
cypress/screenshots

# for testing in smaller files
public/_**.html
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.13.1
v20.11.1
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"stylelint.validate": [
"css",
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ Choices works with the following input types, referenced in the documentation as

## Configuration Options

If you want to set global defaults for all instances of Choices, you can use the `Choices.defaults.options` object.
This works with every option.

```js
Choices.defaults.options.noResultsText = 'No results found';
```

### silent

**Type:** `Boolean` **Default:** `false`
Expand Down Expand Up @@ -288,6 +295,13 @@ Pass an array of objects:
}]
```

### choicesContainer

You can't place HTML directly inside option or select tags.
This is a security feature, as it prevents XSS (cross-site scripting) attacks.
If you want to do it regardless, you can set `allowHTML` to `true`, and set the choicesContainer to a valid query selector string or html element.
The children of the `choicesContainer` will be used instead of the option tags inside the select.

### renderChoiceLimit

**Type:** `Number` **Default:** `-1`
Expand Down
28,515 changes: 10,306 additions & 18,209 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,21 @@
"@types/mocha": "^10.0.1",
"@types/sinon": "^10.0.13",
"@types/sinon-chai": "^3.2.9",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.0",
"bundlesize": "^0.18.1",
"bundlesize": "^0.2.1",
"chai": "^4.3.7",
"cross-env": "^7.0.3",
"csso-cli": "^4.0.1",
"cypress": "11.2.0",
"eslint": "^8.28.0",
"cypress": "^13.6.4",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-compat": "4.0.2",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
Expand All @@ -87,12 +88,12 @@
"jsdom": "^20.0.3",
"lint-staged": "^13.0.4",
"mocha": "^10.1.0",
"nodemon": "^2.0.20",
"nodemon": "^3.0.3",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"postcss": "^8.4.19",
"postcss-cli": "^10.0.0",
"prettier": "^2.8.0",
"prettier": "^2.8.8",
"sass": "^1.56.1",
"sinon": "^15.0.0",
"sinon-chai": "^3.7.0",
Expand Down
Loading