From d041001168a4623d9ec103d2e6e1845ce801c2aa Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 11 Sep 2018 20:06:35 +0200 Subject: [PATCH] fixed ternary choice dealing with unknown values (fix #633) --- docs/changelog.md | 3 ++- umap/static/umap/js/umap.forms.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 10aa6e59..2982581e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -51,7 +51,8 @@ COMMIT; ## 1.0.0.rc-5 -- Fixed user autocompletion in permissions panel (cf #635) +- fixed user autocompletion in permissions panel (cf #635) +- fixed ternary choice dealing with unknown values (cf #633) ## 1.0.0.rc-4 diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index 2c24f371..5bdd6ac2 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -538,7 +538,7 @@ L.FormBuilder.MultiChoice = L.FormBuilder.Element.extend({ fetch: function () { var value = this.backup = this.toHTML(); - if (value === null || value === undefined) value = this.default; + if (!this.container.querySelector('input[type="radio"][value="' + value + '"]')) value = this.default; this.container.querySelector('input[type="radio"][value="' + value + '"]').checked = true; },