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
  • Loading branch information
bc-alexsaiannyi committed Jan 11, 2021
1 parent c169162 commit 1a6f0b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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. [#1942](https://github.com/bigcommerce/cornerstone/pull/1942)
- 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 = $('[src^="https://www.google.com/recaptcha/api2"]');
}

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', 'Google recaptcha');
}

const $createAccountForm = classifyForm(this.formCreateSelector);
const $loginForm = classifyForm('.login-form');
const $forgotPasswordForm = classifyForm('.forgot-password-form');
Expand Down

0 comments on commit 1a6f0b3

Please sign in to comment.