Testing

Withdrawal and cancel buttons: test the path with the keyboard, from the first button to the confirmation

7 min read
Mikhail ShaymardanovWeb Quality and Accessibility Expert

The EU rule behind the withdrawal button gives online sellers no number of clicks. It describes two labeled steps: “withdraw from contract here” opens a short form, and “confirm withdrawal” sends it. Germany and France ask for the same kind of path to cancel a subscription. Walking these steps with the keyboard, as a customer without a mouse does, shows how far that customer gets.

From the first button to the confirmation, key by key


#How do you test a cancel button with the keyboard?

To test a cancel button with the keyboard, walk the whole cancellation without a mouse, from the signup page to the confirmation. At each step, check four things. Tremors, paralysis or pain make a mouse very hard to steer for some people. They use the keyboard alone or a device that acts like one, and rely on the keyboard to activate every function of a page.

The rules behind these buttons, though, never mention the keyboard. The withdrawal button comes from Directive (EU) 2023/2673. EU countries had to apply it from June 19, 2026. When a contract signed on a website or an app carries a right of withdrawal, the consumer can withdraw there too, for the whole withdrawal period. “Withdraw from contract here” leads to a short statement (a name, the contract, where to send the confirmation electronically), and “confirm withdrawal” sends it.

Some countries also require an always-available cancel button for subscriptions: Germany in section 312k of its Civil Code (in German), France in article L215-1-1 of its Consumer Code (in French). None of these rules counts clicks, and they apply to businesses of every size.

Keyboard access comes from another law, the European Accessibility Act, which has covered e-commerce since June 28, 2025: any website or app where consumers sign a contract. In its examples of how a service can make its website accessible, the Act lists “making all functionality available from a keyboard”. Microenterprises that provide services, the smallest businesses, are exempt.

#Which keys do you use, and on which path?

Five keys are enough. Tab moves forward from one element to the next, and Shift+Tab moves back. At each stop, the element reached gets the focus: it's the one the keyboard controls, and an outline shows it. Enter activates a link or a button, Space only a button, and Esc closes a dialog.

If the first cancel button is a link, Space scrolls the page without opening it, which is normal. On a Mac with default settings, Safari skips links and buttons until one box is checked in Safari > Settings > Advanced: “Press Tab to highlight each item on a webpage”.

Start on the page where people subscribe: the EU rule wants the withdrawal button prominently displayed on the site and easy to reach. If the site asks existing customers to sign in first, test that sign-in too, then run the path again without an account.

#What should you check at each step?

Four checks apply at each step, on any site:

We ran this test on the demo of The Yard, a gym selling memberships online. On its Memberships page, the seventh press of Tab reaches “Cancel your membership”, after the logo, the three menu links and the two “Join” buttons.

Screenshot: the Memberships page of The Yard, a fitness club in Millford, with its red disc logo, a three-link menu, a photo of a rower lit in the dark, two plans at €29 and €39 a month with their “Join” buttons, then “Already a member?” and the “Cancel your membership” link, with a black outline around it.Marker 1. The “Cancel your membership” link, with its focus outline, below the two plans.
On The Yard's Memberships page, the seventh Tab lands on “Cancel your membership”marker 1, below the two plans: the page where people join also carries the link to cancel.

Enter opens the form and its four fields: full name, email address, member number and requested end date. Germany's law lists all four, plus the type of cancellation. On paper, this form sits between the two labeled buttons. With the keyboard, the form alone takes five presses of Tab, four entries and Enter.

Click the demo, then press the key shown, or move on with “Next step”. Escape leaves the demo.
6 steps

On The Yard's form, five presses of Tab, four entries and Enter lead to the review page, where the button that sends the cancellation waits.

All four checks pass, so the longest part of the path works with the keyboard. Labels and error messages, outside this checklist, have their own guide.

Accessible forms in HTML: required fields, error messages and validation

#Why doesn't the cancel button work with the keyboard?

With the keyboard, a cancellation gets stuck as soon as one step relies on an element that Tab never reaches. In The Yard's demo, that element is “Confirm cancellation”, the second button, which sends the request.

The review page repeats the four details from the form, with a link to edit them. With the keyboard, we watched Tab and Shift+Tab jump over the button, and no key activated it.

Click the demo, then press the key shown, or move on with “Next step”. Escape leaves the demo.
3 steps

On The Yard's review page, the second Tab goes from “Edit my details” to “Legal notice”: “Confirm cancellation” is never reached.

With a mouse, though, the cancellation goes through, and a manager who tries the site sees nothing wrong. The long form passes with the keyboard too. The customer without a mouse gets stuck on the last button, the simplest on the screen and the only one that sends the cancellation. Nothing goes out, no confirmation arrives, and the membership keeps running.

#Why does the Tab key skip this button?

On screen, “Confirm cancellation” looks like a button. In the code, it's a block of text, a <div>, that only reacts to a click. A block like that doesn't join the Tab order on its own, as MDN, the web developers' reference, points out.

That's why the button fails the first of the four checks. In WCAG, the international accessibility guidelines, this falls under success criterion 2.1.1 Keyboard. EN 301 549, the European accessibility standard, applies it to every web page as clause 9.2.1.1.

The fix is a real button that looks the same and shows its focus outline: with a mouse, nothing changes. The developer will find how to make that swap in our article on tabIndex.

Avoid

Screenshot: the bottom of The Yard's review page, with the member number, the requested end date, the “Edit my details” link, the red “Confirm cancellation” button with no outline, and the footer's “Legal notice” link with a gold outline around it.Marker 1. The “Confirm cancellation” button, with no outline: the focus has moved on to “Legal notice”.

Correct

Screenshot: the same bottom of the page after the fix, the red “Confirm cancellation” button with a black outline around it, and “Legal notice” with no outline.Marker 1. The “Confirm cancellation” button, with its black focus outline.
After the second Tab, the fake buttonmarker 1 has no outline while the focus outline sits on “Legal notice”; the real buttonmarker 1 looks the same but takes the black outline.
The “tabIndex should only be declared on interactive elements” error: what to use instead

#What other blockers should you look for along the path?

Look for two more blockers at each step:

  • An invisible focus. Tab reaches the button, but no outline shows it, and the customer loses their place. The fix is in our focus-visible guide.
  • A dialog that mishandles the focus. A confirmation opens, but the focus stays behind it, or Esc doesn't close it. A well-built dialog takes the focus, keeps it inside while it's open and closes with Esc: these rules, tested on a cart drawer.
Shopify theme accessibility: what Shopify checked, and what's left to test

#How do you report the blocker to your developer?

A good ticket lets the developer reproduce the blocker. It gives the page, the browser, the starting point, the key presses counted, the expected and actual results, and the accessibility criterion.

Title: Online cancellation blocked with the keyboard at the step Page: Browser: Start: Keys: Expected: Actual: Impact: a customer who doesn't use a mouse can't send their cancellation online. Criterion:

8 fields to fill

Count the presses from a precise starting point, and name each element by its visible text. The developer retraces the path and finds “Confirm cancellation” by searching the code. On the “Criterion” line, pick the option that matches the blocker: a button never reached, an invisible focus or a jumbled focus order.

On The Yard's fixed demo, the second Tab on the review page stops on “Confirm cancellation”, and Enter sends the cancellation. The next page announces a confirmation email. The withdrawal rule requires a confirmation of receipt on a “durable medium”: a message the customer keeps and can reread. EU consumer law counts email as one.

Screenshot: The Yard's “Cancellation received” page, at step 3 Confirmation, announcing a confirmation email to iris.gardner@mail.example, then the end of the contract and of gym access on December 31, 2026, and no cancellation fee.Marker 1. The sentence that announces the confirmation email, with the contract's end date and the effects of the cancellation.
After Enter on “Confirm cancellation”, The Yard's “Cancellation received” page announces the confirmation emailmarker 1: this time, the cancellation goes out.

From the Memberships page to this confirmation, we counted 17 key presses and four entries. On paper, the path has two labeled buttons. With the keyboard, every move to reach them is one more press, and the customer without a mouse gets all the way through. The ticket closes when this path, replayed with the keyboard, reaches this page.


After the keyboard test, an Includdy scan lists the non-conformities on each page of the path, each with a test plan (steps and expected result) to replay after the fix, like this ticket. On the form, the scan and our manual guides catch what the keyboard misses, such as a field without a label.


Share this article

Frequently asked questions

The withdrawal button is the “withdraw from contract here” function that businesses must offer consumers whenever an online contract carries a right of withdrawal, under rules EU countries had to apply from June 19, 2026. Its label may also be an unambiguous equivalent, and either wording must be easily legible. On the website or app where the contract was signed, the button must stay prominently displayed and easy to reach for the whole withdrawal period. It opens a short form, the withdrawal statement, where the consumer gives or confirms their name, the contract and where to send the confirmation electronically. A second button, with an easily legible label that says only “confirm withdrawal” or an unambiguous equivalent, sends the statement. Without undue delay, the business must then send an acknowledgment of receipt on a durable medium, such as an email, with the statement's content and the date and time it was submitted.

These rules come from Directive (EU) 2023/2673 and cover financial services as well. Each EU country had to write them into its own law, and EUR-Lex lists those laws country by country. Small businesses are covered too: the directive only encourages EU countries to take their needs into account when they apply it. The button adds to the other ways of withdrawing, such as the model withdrawal form.

Not if they are microenterprises providing services: Directive (EU) 2019/882, the European Accessibility Act, exempts them. A microenterprise employs fewer than 10 people, with a yearly turnover or balance sheet total of €2 million or less (who is exempt, and on what terms). For the businesses it covers, the Act gives “making all functionality available from a keyboard” as an example of how to make a website accessible.

The EU withdrawal button applies whatever the size of the business, and so do the cancel buttons that Germany and France require. None of these rules mentions the keyboard. Still, a customer who can't reach the button that sends the request can't withdraw or cancel online, so the keyboard test is worth running for a microenterprise too.

“Withdraw from contract here”, or an unambiguous wording that means the same, in easily legible text (the directive). The button must be prominently displayed and easy to reach for the whole withdrawal period.

The second button, the one that sends the withdrawal statement, says “confirm withdrawal” or an unambiguous equivalent, and nothing else. Beyond legibility, the rule sets no color or size for either button.