Skip to content

fix(surveys): multiple choice survey submit button bug#822

Merged
liyiy merged 2 commits intomasterfrom
fix-surveys-multiple
Oct 4, 2023
Merged

fix(surveys): multiple choice survey submit button bug#822
liyiy merged 2 commits intomasterfrom
fix-surveys-multiple

Conversation

@liyiy
Copy link
Contributor

@liyiy liyiy commented Oct 4, 2023

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 it

Checklist

@liyiy liyiy requested a review from neilkakkar October 4, 2023 16:39
@liyiy
Copy link
Contributor Author

liyiy commented Oct 4, 2023

I think I'm going to add some more tests... but let's get this in ASAP first...

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Size Change: -2 B (0%)

Total Size: 726 kB

Filename Size Change
dist/surveys.js 38.7 kB -2 B (0%)
ℹ️ View Unchanged
Filename Size
dist/array.full.js 177 kB
dist/array.js 119 kB
dist/es.js 119 kB
dist/module.js 119 kB
dist/recorder-v2.js 95 kB
dist/recorder.js 58.3 kB

compressed-size-action

// 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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok it works

@liyiy liyiy requested a review from neilkakkar October 4, 2023 16:57
@liyiy liyiy merged commit d4d178a into master Oct 4, 2023
@liyiy liyiy deleted the fix-surveys-multiple branch October 4, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants