From 0c0944b5e3157f6a7ae5caf80c1785fb23de13c2 Mon Sep 17 00:00:00 2001 From: Virginia Balseiro Date: Tue, 25 Jan 2022 13:26:55 +0100 Subject: [PATCH] Fix: set error value correctly in Image component --- CHANGELOG.md | 4 ++++ src/components/image/index.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b4a013..cccd4ca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Unreleased +### Bugfixes + +- When `Image` component is editable, the value error will be set if there is no image available, which means the error component (default or custom) wis displayed correctly. + ## 2.7.0 ( January 20, 2022 ) ### New features diff --git a/src/components/image/index.tsx b/src/components/image/index.tsx index c22c826a..17489de4 100644 --- a/src/components/image/index.tsx +++ b/src/components/image/index.tsx @@ -79,7 +79,7 @@ export function Image({ const { value, thing, error: thingError } = values; let valueError; - if (!edit && !value) { + if (!value) { valueError = new Error("No value found for property."); } const isFetchingThing = !thing && !thingError;