Fix: deselect collections in the collections filter

This commit is contained in:
Jorge Manrubia
2025-10-02 14:24:57 +02:00
parent 2f38cb3ecd
commit 6b10d23fa9
2 changed files with 2 additions and 7 deletions
@@ -82,15 +82,13 @@ export default class extends Controller {
#clearHiddenFields() {
this.element.querySelectorAll('input[type="hidden"]').forEach(field => {
if (field !== this.hiddenField) {
field.remove()
}
field.remove()
})
}
#addHiddenFields() {
this.#selectedValues().forEach(value => {
const [field] = this.hiddenFieldTemplateTarget.content.cloneNode(true).children
const [ field ] = this.hiddenFieldTemplateTarget.content.cloneNode(true).children
field.removeAttribute("id")
field.value = value
this.element.appendChild(field)