diff --git a/src/widgets/RequiredErrorMessage.tsx b/src/widgets/RequiredErrorMessage.tsx
index 478c79a..35629c7 100644
--- a/src/widgets/RequiredErrorMessage.tsx
+++ b/src/widgets/RequiredErrorMessage.tsx
@@ -1,7 +1,11 @@
import React from 'react'
import { Error } from './Widget'
-export const RequiredErrorMessage = () => {
+export const RequiredErrorMessage = ({ show = false }: { show?: boolean }) => {
+ if (!show) {
+ return null
+ }
+
return (
At least one selection must be made
)
diff --git a/src/widgets/StringChoiceWidget.tsx b/src/widgets/StringChoiceWidget.tsx
index 0cde4f9..323dd6e 100644
--- a/src/widgets/StringChoiceWidget.tsx
+++ b/src/widgets/StringChoiceWidget.tsx
@@ -140,8 +140,10 @@ const StringChoiceWidget = ({
const [defaultValue] = selection || []
+ const requiredError = !bypassed && required && !selection?.length
+
return (
-
+
- {!bypassed && required && !selection?.length ? (
-
- ) : null}
+