From b00d82eda047b9cea1d591aa7aacdbb8a769d73b Mon Sep 17 00:00:00 2001 From: "Storm B. Heg" Date: Thu, 13 Jul 2023 10:23:03 +0200 Subject: [PATCH] Ensure StreamField panels validation errors are visible ...by rendering panels as expanded, regardless of the collapse setting specified by the Wagtail implementor. Fixes #8990 partially. --- .../src/components/StreamField/blocks/BaseSequenceBlock.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/components/StreamField/blocks/BaseSequenceBlock.js b/client/src/components/StreamField/blocks/BaseSequenceBlock.js index 64a3dd0cfe3b..1f76d84814e9 100644 --- a/client/src/components/StreamField/blocks/BaseSequenceBlock.js +++ b/client/src/components/StreamField/blocks/BaseSequenceBlock.js @@ -349,6 +349,11 @@ export class BaseSequenceChild extends EventEmitter { setError(error) { this.block.setError(error); + + // If there is an error, the panel should be expanded always so the error is not obscured + if (error) { + toggleCollapsiblePanel(this.toggleElement, true); + } } focus(opts) {