Fixed invalid selector for data-members-newsletter attribute (#18039)

no refs

Fixed invalid selector for `data-members-newsletter` attribute
This commit is contained in:
Michael Barrett 2023-09-08 14:21:56 +01:00 committed by GitHub
parent d9b36567ca
commit b472ffb39b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ export function formSubmitHandler({event, form, errorEl, siteUrl, submitHandler}
labels.push(labelInputs[i].value);
}
let newsletterInputs = event.target.querySelectorAll('input[type=hidden][data-members-newsletter], input[type=checkbox][data-members-newsletter]:checked, input[type=radio][data-members-newsletter]:selected') || [];
let newsletterInputs = event.target.querySelectorAll('input[type=hidden][data-members-newsletter], input[type=checkbox][data-members-newsletter]:checked, input[type=radio][data-members-newsletter]:checked') || [];
for (let i = 0; i < newsletterInputs.length; ++i) {
newsletters.push({id: newsletterInputs[i].value});
}

View File

@ -63,7 +63,7 @@ function getMockData({newsletterQuerySelectorResult = null} = {}) {
value: 'Gold'
}];
}
if (elem === 'input[type=hidden][data-members-newsletter], input[type=checkbox][data-members-newsletter]:checked, input[type=radio][data-members-newsletter]:selected' && newsletterQuerySelectorResult) {
if (elem === 'input[type=hidden][data-members-newsletter], input[type=checkbox][data-members-newsletter]:checked, input[type=radio][data-members-newsletter]:checked' && newsletterQuerySelectorResult) {
return newsletterQuerySelectorResult;
}
}