Allow to override MultiChoice default value

This commit is contained in:
Yohan Boniface 2023-10-09 14:54:12 +02:00
parent 7fd905741a
commit ce39afc64a

View file

@ -733,7 +733,7 @@ L.FormBuilder.MultiChoice = L.FormBuilder.Element.extend({
fetch: function () {
let value = (this.backup = this.toHTML())
if (!this.container.querySelector(`input[type="radio"][value="${value}"]`))
value = this.default
value = typeof(this.options.default) !== 'undefined' ? this.options.default : this.default
this.container.querySelector(`input[type="radio"][value="${value}"]`).checked = true
},