Skip to content

Commit d5ccd6f

Browse files
author
Alvin
committed
adds selectize.multiArrayOnly setting to turn it off for normal selects and only use the tagging component (better for frameworks that already override select)
1 parent 22ccdd2 commit d5ccd6f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

dist/jsoneditor.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jsoneditor.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/defaults.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ JSONEditor.defaults.resolvers.unshift(function(schema) {
250250
return "checkbox";
251251
}
252252
// Otherwise, default to select menu
253-
return (JSONEditor.plugins.selectize.enable) ? 'selectize' : 'select';
253+
return (JSONEditor.plugins.selectize.enable && !JSONEditor.plugins.selectize.multiArrayOnly) ? 'selectize' : 'select';
254254
}
255255
});
256256
// Use the multiple editor for schemas where the `type` is set to "any"
@@ -280,7 +280,7 @@ JSONEditor.defaults.resolvers.unshift(function(schema) {
280280
});
281281
// Use the `select` editor for dynamic enumSource enums
282282
JSONEditor.defaults.resolvers.unshift(function(schema) {
283-
if(schema.enumSource) return (JSONEditor.plugins.selectize.enable) ? 'selectize' : 'select';
283+
if(schema.enumSource) return (JSONEditor.plugins.selectize.enable && !JSONEditor.plugins.selectize.multiArrayOnly) ? 'selectize' : 'select';
284284
});
285285
// Use the `enum` or `select` editors for schemas with enumerated properties
286286
JSONEditor.defaults.resolvers.unshift(function(schema) {
@@ -289,7 +289,7 @@ JSONEditor.defaults.resolvers.unshift(function(schema) {
289289
return "enum";
290290
}
291291
else if(schema.type === "number" || schema.type === "integer" || schema.type === "string") {
292-
return (JSONEditor.plugins.selectize.enable) ? 'selectize' : 'select';
292+
return (JSONEditor.plugins.selectize.enable && !JSONEditor.plugins.selectize.multiArrayOnly) ? 'selectize' : 'select';
293293
}
294294
}
295295
});

0 commit comments

Comments
 (0)