Skip to content

Commit

Permalink
fix(surveys): multiple choice survey submit button bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiy committed Oct 4, 2023
1 parent 9f65f91 commit 7c5cbf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extensions/surveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ export const createMultipleChoicePopup = (posthog: PostHog, survey: Survey, ques
: formElement.querySelectorAll('input[type=checkbox]:checked')
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // TODO: Fix this, error because it doesn't recognize node list as an array
if (selectedChoices && (selectedChoices.length ?? 0) > 0) {
if ((singleOrMultiSelect === 'single_choice' && selectedChoices) || (selectedChoices.length ?? 0) > 0) {
;(formElement.querySelector('.form-submit') as HTMLButtonElement).disabled = false
} else {
;(formElement.querySelector('.form-submit') as HTMLButtonElement).disabled = true
Expand Down

0 comments on commit 7c5cbf4

Please sign in to comment.