From b472ffb39b8b03d17b6a9b7208776178cb382977 Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Fri, 8 Sep 2023 14:21:56 +0100 Subject: [PATCH] Fixed invalid selector for `data-members-newsletter` attribute (#18039) no refs Fixed invalid selector for `data-members-newsletter` attribute --- apps/portal/src/data-attributes.js | 2 +- apps/portal/src/tests/data-attributes.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/portal/src/data-attributes.js b/apps/portal/src/data-attributes.js index 863f34a733..3ee351383b 100644 --- a/apps/portal/src/data-attributes.js +++ b/apps/portal/src/data-attributes.js @@ -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}); } diff --git a/apps/portal/src/tests/data-attributes.test.js b/apps/portal/src/tests/data-attributes.test.js index d50c5ce927..1846e0535c 100644 --- a/apps/portal/src/tests/data-attributes.test.js +++ b/apps/portal/src/tests/data-attributes.test.js @@ -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; } }