From 1a26094e50b2804015715d65c2cfd3c00eb4ff15 Mon Sep 17 00:00:00 2001 From: Kenny Shepard Date: Wed, 7 Oct 2015 11:49:35 -0400 Subject: [PATCH] Add empty option for non-required dynamic selects --- src/editors/select.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/editors/select.js b/src/editors/select.js index bdb87b96e..b6c394d37 100644 --- a/src/editors/select.js +++ b/src/editors/select.js @@ -299,6 +299,12 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ } var prev_value = this.value; + + // Add an empty option for non-required dynamic select boxes + if(!this.isRequired()){ + select_options.unshift(undefined); + select_titles.unshift(' '); + } this.theme.setSelectOptions(this.input, select_options, select_titles); this.enum_options = select_options;