Skip to content

Commit

Permalink
bug #5383 Fix some issue in usage of TomSelect library (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.x branch.

Discussion
----------

Fix some issue in usage of TomSelect library

I'm seeing this error in the browser console:

<img width="531" alt="js-issue" src="https://user-images.githubusercontent.com/73419/187187994-35cf5261-8501-4eff-bc8e-606524b47d60.png">

This should work as before ... but it doesn't matter, because checking the TomSelect docs I saw that you can just pass `null` to `maxOptions` option to achieve the same result (see https://tom-select.js.org/docs/#maxoptions). The JS issue disappeared for me after this change.

Commits
-------

6b66cf2 Fix some issue in usage of TomSelect library
  • Loading branch information
javiereguiluz committed Aug 31, 2022
2 parents 89b6e63 + 6b66cf2 commit 565a405
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Autocomplete

#createAutocomplete(element) {
const config = this.#mergeObjects(this.#getCommonConfig(element), {
maxOptions: element.options.length,
maxOptions: null,
});

return new TomSelect(element, config);
Expand All @@ -78,7 +78,7 @@ export default class Autocomplete
labelField: 'label_raw',
searchField: ['label_text'],
options: autoSelectOptions,
maxOptions: element.options.length,
maxOptions: null,
render: {
item: function(item, escape) {
return `<div>${item.label_raw}</div>`;
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Resources/public/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"/app.11183413.rtl.css"
],
"js": [
"/app.b81bbd60.js"
"/app.2fd2f280.js"
]
},
"form": {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"app.css": "app.11183413.css",
"app.rtl.css": "app.11183413.rtl.css",
"app.js": "app.b81bbd60.js",
"app.js": "app.2fd2f280.js",
"form.js": "form.640f3bdf.js",
"page-layout.js": "page-layout.3347892e.js",
"page-color-scheme.js": "page-color-scheme.f676dfa6.js",
Expand Down

0 comments on commit 565a405

Please sign in to comment.