diff --git a/dev-test/config.yml b/dev-test/config.yml index 06ed38c8..2ffe5041 100644 --- a/dev-test/config.yml +++ b/dev-test/config.yml @@ -143,6 +143,13 @@ collections: # A list of collections the CMS should be able to edit options: ['a', 'b', 'c'], multiple: true, } + - { + label: 'Select numeric', + name: 'select_numeric', + widget: 'select', + options: + [{ label: 'One', value: 1 }, { label: 'Two', value: 2 }, { label: 'Three', value: 3 }], + } - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } - label: 'Object' name: 'object' diff --git a/packages/netlify-cms-widget-select/src/schema.js b/packages/netlify-cms-widget-select/src/schema.js index e5191f3d..625db3d2 100644 --- a/packages/netlify-cms-widget-select/src/schema.js +++ b/packages/netlify-cms-widget-select/src/schema.js @@ -8,11 +8,12 @@ export default { items: { oneOf: [ { type: 'string' }, + { type: 'number' }, { type: 'object', properties: { label: { type: 'string' }, - value: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, }, required: ['label', 'value'], },