Skip to content

Commit

Permalink
Show required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vesnushka committed Nov 15, 2024
1 parent 9bb19aa commit 8d9cd6f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props
export function QuestionLabel(props: Props) {
const qrfContext = useQuestionnaireResponseFormContext();
const { questionItem, ...other } = props;
const { text, helpText } = questionItem;
const { text, helpText, required } = questionItem;
const readOnly = qrfContext.readOnly || questionItem.readOnly || questionItem.hidden;
const { type: groupType } = useContext(GroupContext);

Expand All @@ -36,6 +36,7 @@ export function QuestionLabel(props: Props) {
})}
{...other}
>
{required ? <span style={{ color: 'red' }}>{`* `}</span> : null}
{text}
</label>
)}
Expand Down

0 comments on commit 8d9cd6f

Please sign in to comment.