Skip to content

Commit d218fd1

Browse files
author
Oleksandr Dubovyk
committed
MC-20881: Checkout email input field keeps aria-invalid='true' attribute and value after successful validation
- fixed
1 parent b6e9491 commit d218fd1

File tree

1 file changed

+7
-2
lines changed
  • app/code/Magento/Checkout/view/frontend/web/js/view/form/element

1 file changed

+7
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,17 @@ define([
145145
var loginFormSelector = 'form[data-role=email-with-possible-login]',
146146
usernameSelector = loginFormSelector + ' input[name=username]',
147147
loginForm = $(loginFormSelector),
148-
validator;
148+
validator,
149+
valid;
149150

150151
loginForm.validation();
151152

152153
if (focused === false && !!this.email()) {
153-
return !!$(usernameSelector).valid();
154+
valid = !!$(usernameSelector).valid();
155+
if (valid) {
156+
$(usernameSelector).removeAttr('aria-invalid aria-describedby');
157+
}
158+
return valid;
154159
}
155160

156161
validator = loginForm.validate();

0 commit comments

Comments
 (0)