diff --git a/src/directives/decorators/bootstrap/select.html b/src/directives/decorators/bootstrap/select.html
index 05c45a5ae..c7bd41c32 100644
--- a/src/directives/decorators/bootstrap/select.html
+++ b/src/directives/decorators/bootstrap/select.html
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/services/schema-form.js b/src/services/schema-form.js
index b1664f0e2..c2b52bfaa 100644
--- a/src/services/schema-form.js
+++ b/src/services/schema-form.js
@@ -359,6 +359,19 @@ angular.module('schemaForm').provider('schemaForm',
}
}
+ if (obj.type === 'select' && obj.titleMap) {
+ // we check whether null value is in titleMap. if so, we fix possible null
+ // label and set allowAutoNullOption to false, then leave the titleMap as it is
+ obj.titleMap.forEach(function(item) {
+ if (item.value === null) {
+ if (obj.allowAutoNullOption === undefined)
+ obj.allowAutoNullOption = false;
+ if (item.name === null)
+ item.name = '';
+ }
+ });
+ }
+
// Are we inheriting readonly?
if (readonly === true) { // Inheriting false is not cool.
obj.readonly = true;