Skip to main content
onEscapeKeyPressed fires when the shopper presses the literal Escape key while the element (or one of its sub-fields) has focus. Use it to close your own modals, blur the input, or restore prior UI state.

Payload

The key is always Escape by definition, so the payload carries only elementType.

Example

The SDK does not preventDefault()

Default browser behavior (for example, dismissing a native autofill panel) is preserved. Merchants own the response.

Not emitted by wallets or submitButton

applePay, googlePay, and submitButton do not emit this event. The event key is omitted from their event map, so subscribing is a TypeScript error and a runtime no-op (with a console warning).
  • Wallets render inside their own rendering surface, whose native payment sheet captures keystrokes once open.
  • submitButton has no shopper-dismissable input.
To react to a shopper abandoning a wallet sheet, subscribe to onExit instead.

Per-element wiring

  • Fires once per keypress on email, phone, fullName, billingAddress, shippingAddress, checkout, and manual-mode bank, regardless of which sub-field had focus.
  • bank fires only in manual mode. Plaid opens an external modal that handles Escape on its own.
  • card is best-effort: Escape fires inside the holder-name and postal-code inputs, but not inside the card number, expiration, or security code fields.

See also

Last modified on July 29, 2026