From 115860350aa901749d240cb275cada29b8d541f8 Mon Sep 17 00:00:00 2001 From: Vladimir Barcovsky Date: Tue, 14 Jan 2020 03:33:06 +0400 Subject: [PATCH] Close issue #1548 (#2211) Co-authored-by: Mike --- .changeset/lazy-hats-begin.md | 5 +++++ packages/fields/src/types/Relationship/views/Field.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/lazy-hats-begin.md diff --git a/.changeset/lazy-hats-begin.md b/.changeset/lazy-hats-begin.md new file mode 100644 index 00000000000..c59688e1166 --- /dev/null +++ b/.changeset/lazy-hats-begin.md @@ -0,0 +1,5 @@ +--- +'@keystonejs/fields': patch +--- + +Fixed work of relation select diff --git a/packages/fields/src/types/Relationship/views/Field.js b/packages/fields/src/types/Relationship/views/Field.js index d154d7da0b6..32e407c5fc0 100644 --- a/packages/fields/src/types/Relationship/views/Field.js +++ b/packages/fields/src/types/Relationship/views/Field.js @@ -169,7 +169,7 @@ export default class RelationshipField extends Component { const { field, onChange } = this.props; const { many } = field.config; if (many) { - onChange(option.map(i => i.value)); + onChange(option ? option.map(i => i.value) : []); } else { onChange(option ? option.value : null); }