From 0c28e89b414fa30ac556e70499136435a4ff7e26 Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Fri, 19 Dec 2025 00:42:47 +0530 Subject: [PATCH] fix: missing required question warning (#6998) --- .../src/components/elements/consent.tsx | 2 +- .../src/components/elements/date.tsx | 28 +++++++++++-------- .../src/components/elements/file-upload.tsx | 5 ++-- .../src/components/elements/matrix.tsx | 2 ++ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/packages/survey-ui/src/components/elements/consent.tsx b/packages/survey-ui/src/components/elements/consent.tsx index 7cf7bab4f8..e507d1164e 100644 --- a/packages/survey-ui/src/components/elements/consent.tsx +++ b/packages/survey-ui/src/components/elements/consent.tsx @@ -74,7 +74,7 @@ function Consent({ onCheckedChange={handleCheckboxChange} disabled={disabled} aria-invalid={Boolean(errorMessage)} - aria-required={required} + required={required} /> {/* need to use style here because tailwind is not able to use css variables for font size and weight */} ): React.JSX.Element { // Initialize date from value string, parsing as local time to avoid timezone issues const [date, setDate] = React.useState(() => { @@ -128,17 +130,21 @@ function DateElement({ {/* Headline */} - {/* Calendar - Always visible */} -
- +
+ + {/* Calendar - Always visible */} +
+ +
); diff --git a/packages/survey-ui/src/components/elements/file-upload.tsx b/packages/survey-ui/src/components/elements/file-upload.tsx index 2674b7c382..77520c888d 100644 --- a/packages/survey-ui/src/components/elements/file-upload.tsx +++ b/packages/survey-ui/src/components/elements/file-upload.tsx @@ -2,7 +2,6 @@ import { Upload, UploadIcon, X } from "lucide-react"; import * as React from "react"; import { ElementError } from "@/components/general/element-error"; import { ElementHeader } from "@/components/general/element-header"; -import { Input } from "@/components/general/input"; import { cn } from "@/lib/utils"; /** @@ -193,11 +192,11 @@ function UploadArea({ id={`${inputId}-label`}> {placeholderText}
- { handleRowChange(row.id, newColumnId); }} + name={rowGroupId} disabled={disabled} required={required} aria-invalid={Boolean(errorMessage)}> @@ -142,6 +143,7 @@ function Matrix({