-
Notifications
You must be signed in to change notification settings - Fork 26
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
Commencement selected options fix #1401
Conversation
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.
Nice catch -- minor tweak required.
@@ -84,7 +84,9 @@ | |||
// if we've selected all provisions, ensure we don't send back any selections | |||
if (form.elements.all_provisions.checked) { | |||
// we can't iterate over this in-place, so do this instead | |||
while (form.elements.provisions.selectedOptions.length > 0) form.elements.provisions.selectedOptions[0].selected = false; | |||
while ([...form.elements.provisions].some(provision => provision.checked)) { | |||
form.elements.provisions[0].checked = false; |
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.
Almost... the goal of the original code is to uncheck everything when all_provisions is checked (it does the first element in selectedOptions
only because selectedOptions
slowly gets smaller and smaller.
The new code can just loop over all the elements and set checked
to false on all of them.
…ecked uncheck all selections
form.elements.provisions
is aRadioNodeList
form.elements.provisions.selectedOptions
is undefinedFix:
if
all_provisions
is checked uncheck allprovisions
resolves #1399