From 6765bbd2fd041a5aa8cee8033f6710d2262c37c4 Mon Sep 17 00:00:00 2001 From: Bartholomew Date: Thu, 5 Sep 2019 20:06:56 +0100 Subject: [PATCH] fix(core): list widget pattern validation (#2599) * fix list widget pattern validation * remove array value check --- .../src/components/Editor/EditorControlPane/Widget.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js b/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js index c05de96d..0ee846c9 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js @@ -132,6 +132,9 @@ export default class Widget extends Component { return { error: false }; } + // Convert list input widget value to string for pattern test + List.isList(value) && (value = value.join(',')); + if (pattern && !RegExp(pattern.first()).test(value)) { const error = { type: ValidationErrorTypes.PATTERN,