Skip to content

Commit

Permalink
fix(storefront): BCTHEME-155 fix recaptcha announcement for hidden co…
Browse files Browse the repository at this point in the history
…ntent (#1943)
  • Loading branch information
bc-alexsaiannyi authored Jan 18, 2021
1 parent c169162 commit bff8526
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Fixed announcement of reCAPTCHA hidden content by screen reader. [#1943](https://github.com/bigcommerce/cornerstone/pull/1943)
- Carousel buttons do not receive focus. [#1937](https://github.com/bigcommerce/cornerstone/pull/1937)
- Empty cart message not read by screen reader. [#1935](https://github.com/bigcommerce/cornerstone/pull/1935)
- No tooltips provided for carousel buttons. [#1934](https://github.com/bigcommerce/cornerstone/pull/1934)
Expand Down
5 changes: 5 additions & 0 deletions assets/js/theme/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class Auth extends PageManager {
super(context);
this.validationDictionary = createTranslationDictionary(context);
this.formCreateSelector = 'form[data-create-account-form]';
this.recaptcha = $('.g-recaptcha iframe[src]');
}

registerLoginValidation($loginForm) {
Expand Down Expand Up @@ -175,6 +176,10 @@ export default class Auth extends PageManager {
* Request is made in this function to the remote endpoint and pulls back the states for country.
*/
onReady() {
if (!this.recaptcha.attr('title')) {
this.recaptcha.attr('title', this.context.recaptchaTitle);
}

const $createAccountForm = classifyForm(this.formCreateSelector);
const $loginForm = classifyForm('.login-form');
const $forgotPasswordForm = classifyForm('.forgot-password-form');
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@
"heading": "Your account has been created",
"intro": "Thank you for creating your account at {store_name}. Your account details have been emailed to <strong>{email}</strong>",
"continue": "Continue Shopping"
}
},
"recaptcha_title": "Google recaptcha"
},
"login": {
"heading": "Sign in",
Expand Down
1 change: 1 addition & 0 deletions templates/pages/auth/create-account.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{inject 'passwordRequirements' settings.password_requirements}}
{{inject 'recaptchaTitle' (lang 'create_account.recaptcha_title')}}
{{#partial "page"}}
{{> components/common/breadcrumbs breadcrumbs=breadcrumbs}}
<h1 class="page-heading">{{lang 'create_account.heading' }}</h1>
Expand Down

0 comments on commit bff8526

Please sign in to comment.