-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v6] Feature Enter key presses trigger validation #2704
Conversation
…terKeyDown, for CustomCard
|
Size Change: +2.39 kB (+0.33%) Total Size: 729 kB
ℹ️ View Unchanged
|
…for this handler first, then if not present activates the Pay Button
size-limit report 📦
|
…ccess component's payButton
…nt default behaviour, if the activeElement is a PMList header
…_validation' into feature/enterKey_presses_trigger_validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. This is a great feature for v6 👏
Quality Gate passedIssues Measures |
Summary
This adds new functionality to Components - the ability to submit the PM by pressing the Enter key.
Upon the shopper pressing the Enter key, we first look for the presence of an
onEnterKeyPressed
callback (defined atCheckout
config level), and if this is not defined, we trigger validation/submission of the PM form.If an
onEnterKeyPressed
callback is defined - it gets passed an object containing a reference to the PM component (UIElement
) ; and a reference to the active element (document.activeElement
) from which the "Enter" key press was triggeredTested scenarios
Tested:
New unit tests added
Relates to issue: COWEB-1181, #1881, #1242