-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(surveys): multiple choice survey submit button bug #822
Conversation
I think I'm going to add some more tests... but let's get this in ASAP first... |
Size Change: -2 B (0%) Total Size: 726 kB
ℹ️ View Unchanged
|
src/extensions/surveys.ts
Outdated
@@ -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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to use querySelectorAll above for single choice as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THAT MAKES A LOT OF SENSE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait i'm going to test it real quick locally first though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok it works
Changes
Single choice surveys could not be submitted bug
Regular
querySelector
here returns element instead of a list of elements so we should not check.length
on itChecklist