Outta time? Providing users with adjustable time mechanisms to meet WCAG 2.2.1 Timing Adjustable (Level A)

Posted:
Tagged with:

Intro

You must do the thing now, you cannot get distracted and you must do it at a speed that we deem "slow enough", is perhaps the train of thought that some product teams and developers have when implementing various time out mechanisms (not me, I don't think that).

We have all likely encountered these mechanisms whilst using various sites or apps, sometimes we may be provided with a hard limit on how long we have to complete a given task, others it may be due to a period of inactivity and others it may be that information simply doesn't stay on the screen long enough for us all to read and process it. Perhaps the first thing that comes to mind with WCAG 2.2.1 Timing Adjustable (A) success criterion is 'session timeouts', although this success criterion does not focus solely on session timeouts, it's for anything on a website or app that may impose some kind of timed limit upon the users. there are of course exceptions and these are called 'real time exceptions' and 'Essential exceptions', in the SC, some examples are:

The above is just a handful of examples, but there are undoubtedly many more. Many of us may consider timeouts to just be part of the web, often that is quite valid, if they are there to protect us, but oftentimes they are quite unnecessary. As an example, I have dozens of apps on my phone for a variety of purposes, I remain logged in on each of them and that works for me. If I need to purchase something from somewhere, I don't have to go into my password manager to find out what password i used for a particular store. I do get logged out of my banking app, which I personally view as a good thing, as if I were to lose my phone and it was unlocked, I'd hate to think somebody could just transfer money to an account I know nothing of.

One final consideration that we will take a look at, is if there is a valid reason for an exception, that doesn't get you off the hook for other SCs, as an example, 4.1.3 Status Messages (AA) will still apply in most instances, as if I can see a timer of some description on the screen which visually informs me that I have limited time, then naturally, the same information will need to be exposed to screen reader users, or if it changes to red text to indicate impending doom is extremely close, then we of course need to consider contrast etc. We'll also take a look at these aspects, a little later.

The impact of timeouts on users with disabilities

Again, these are just a handful of examples, some were from the WCAG SC and others were just examples I could think of, which I have learned from my time in this field, but as always, users with disabilities may be affected in more ways than I could think of, as their lived experiences are unique to them.

Providing users with accessible mechanisms

I'll summarise the WCAG exceptions, just to refresh our memories:

So, for the most part, the accessible mechanisms are going to be required on the majority of sites, so we will take a look at those first and then we will dig a little deeper with the Essential Exceptions and Real-Time Exceptions.

Accessible mechanisms best practices examples

Full disclaimer here, I'm not going to do a code-along thing on this occasion and the reasons for that are:

The timer non-exceptions

Initially I was going to create three examples, one to turn off the timer, one to extend by 10 minutes and one with a warning that allowed a user to tap the screen or press a key to remain "logged in". In the end I just put those all on the same page, as it would seems easier to follow being able change the settings compare the three accessible mechanisms, all on the same page. I have a set of events set, so any keypress, any moving of the mouse, clicking mouse buttons, interacting with a touchscreen or scrolling the page, will always reset the inactivity timer.

There are a series of inputs on the page, that I have prepopulated with nonsense, for the purposes of this demo, let's just pretend that we had only just typed these out and then got distracted. When the timer actually runs out, quite annoyingly, those inputs are cleared, just to demo how rubbish things often are

Remember, this is just a "working" example, it's not meant for copying the code as a real session timeout would have more moving parts, backend and perhaps AJAX, etc. The next section has the Codepen with the mechanisms.

Accessible timeout mechanisms

Wrapping up

We mostly focussed on session timeouts here, I was going to create a news ticker and a slider, but, well, I opted against those, for good reason. That is not to say that these components are any less worthy of a live example, more that we only have one success criterion to fail a session timeout against, whereas tickers and auto-galleries we can also fail against 2.2.2 Pause, Stop, Hide (A) and that's because it is animated and at least in my case I will immediately reach for the Pause, Stop, Hide SC, as that kind of thing can actually cause significant physical problems for a user, such as seizures and in some cases, a seizure could be severe enough to kill a user. I thought it would have been difficult for me to implement a slider, without making it, well slide and that runs the risk of me causing an issue to a user and that's not something I was willing to do.

I guess what you should be asking is, do we need a timeout, do we need to limit how long somebody has to consume information and can we do this another way? Sure, the answer will not always be to remove a timeout if there is a genuine security need or an exception, but in some instances perhaps they can be removed. We often encounter them and sometimes they don't seem necessary and perhaps most annoyingly, they just spring up on you, without warning. Often i am typing up an issue in a document, I turn to look at the site I am testing and I am logged out, a warning would have been nice, huh?

Whilst the banking apps are unlikely to extend the session by 10 times after a keypress, etc, as at least in the UK I believe the hard limit is 5 mins of inactivity, if a user if forewarned of this, they may be able to plan accordingly. At the start of the flow, tell them everything they will need, which supporting documents, whether they will need to verify their ID or take a photo, etc Also let them know that if they don't interact with the application for 5 minutes, they will be logged out. Life happens, we all get distracted from time to time, a knock on the door, a call, kids, pets, partners, colleagues, whatever. 5 minutes is short, consider saving any progress the user has made, so they do not have to start again. Most of all, always provide a warning, don't just log a user out without a warning, their finger may have been 0.3mm away from tapping the screen.

Share on:

TwitterLinkedIn

Site preferences

Please feel free to display our site, your way by finding the preferences that work best for you. We do not track any data or preferences at all, should you select any options in the groups below, we store a small non-identifiable token to your browser's Local Storage, this is required for your preferencesto persist across pages accordion be present on repeat visits. You can remove those tokens if you wish, by simply selecting Unset, from each preference group.

Theming

Theme
Code block theme

Code theme help

Code block themes can be changed independent of the site theme.

  • Default: (Unset) Code blocks will have the same theme as the site theme.
  • Light 1: will be default for users viewing the light theme, this maintains the minimum 7:1 (WCAG Level AAA) contrast ratio we have used throughout the site, it can be quite difficult to identify the differences in colour between various syntax types, due to the similarities in colour at that contrast ratio
  • Light 2: drops the contrast for syntax highlighting down to WCAG Level AA standards (greater than 4.5:1)
  • Dark: Syntax highlighting has a minimum contrast of 7:1 and due to the dark background differences in colour may appear much more perceivable

Motion

Motion & animation

Motion & animation help

  • Default (Unset): Obeys device settings, if present. If no preference is set, there are subtle animations on this site which will be shown. If you have opted for reduce motion, smooth scrolling as well as expanding and collapsing animations will no longer be present, fading transtitions and micro animations will still be still present.
  • None: All animations and transitions are completely removed, including fade transitions.

Links

Underline all links

Underline all links help

  • Default (Unset): Most links are underlined, with a few exceptions such as: the top level links in the main navigation (on large screens), cards, tags and icon links.
  • Yes: Will add underlines to the exceptions outlined above, resulting in every link being underlined

Text and paragraphs

Font size (main content)

Font size help

This setting does not apply to the site's header or footer regions

  • Default (Unset): Font sizes are set to site defaults
  • Selecting Large or Largest will increase the font size of the main content, the size of the increase depends on various factors such as your display size and/or zoom level. The easiest way to determine which option suits you best would be to view this text after clicking either size's button
Letter spacing

Letter spacing help

  • Default (Unset): Default letter spacing applies
  • Increased: Multiplies the font size by 0.12 and adds the sum as spacing between each character
Line height

Line height help

  • Default (Unset): all text has a minimum line height of 1.5 times the size of the text
  • Increased: all text has a line height of twice the size of the text
Line width

Line width help

  • Default (Unset): all text has a maximum line width of 80 REM units (this averages around 110 characters per line)
  • Decreased: all text has a maximum line width of 55 CH units (this averages around 80 characters per line)
Paragraph spacing

Paragraph spacing help

  • Default (Unset): The space between paragraphs is equivalent to 1.5 times the height of the paragraph's text
  • Increased: The space between paragraphs is equivalent to 2.25 times the height of the paragraph's text
Word spacing preference

Word spacing help

  • Default (Unset): No modifications to word spacing are present
  • Increased: Spaces between words are equivalent to 0.16 times the font size