set searchFields option on jschoice manager

This commit is contained in:
Simon Vieille 2023-10-27 17:02:15 +02:00
parent 93a1e7811d
commit 6736f94eea
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -1,8 +1,9 @@
const Choices = require('choices.js') const Choices = require('choices.js')
const $ = require('jquery')
module.exports = function () { module.exports = () => {
$('*[data-jschoice]').each(function (key, item) { document.querySelectorAll('*[data-jschoice]').forEach((item) => {
return new Choices(item) return new Choices(item, {
searchFields: ['label'],
})
}) })
} }