Skip to content

Commit

Permalink
make id questionnaire specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Virgulto committed Oct 26, 2023
1 parent 291e30e commit 4fa93d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/Questionnaire/SmartApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ export function SmartApp(props: SmartAppProps) {

// update required checkbox ref
const onRequiredCheckboxRefChange = () => {
const requiredCheckbox = document.getElementById('required-fields-checkbox') as HTMLInputElement;
const requiredCheckbox = document.getElementById(questionnaire ? `required-fields-checkbox-${questionnaire.id}` : 'required-fields-checkbox') as HTMLInputElement;
if (requiredCheckbox != null) {
requiredCheckbox.checked = ignoreRequiredCheckbox;
}
Expand Down Expand Up @@ -648,7 +648,7 @@ export function SmartApp(props: SmartAppProps) {
onChange={() => {
updateRequired(false);
}}
id='required-fields-checkbox'
id={questionnaire ? `required-fields-checkbox-${questionnaire.id}` : 'required-fields-checkbox'}
ref={onRequiredCheckboxRefChange}
></input>
</div>
Expand Down

0 comments on commit 4fa93d4

Please sign in to comment.