ArisRamos
Crownpeak (Retired)

Do not use scripting to remove focus when focus is received

Why is this important?

Certain users may only be able to use a keyboard or a mouse but not a combination of both. When navigating on a page using one of these methods such as a keyboard, there are instances where the focus of where you are in the page is removed by a script. This is sometimes done by developers in instances where the focus is visually unappealing.

How can I resolve this issue?

Remove code or scripts that removes the focus on an HTML element. If focus was removed because the design does not look good when there is a focus, look into creating a design that works for the website rather than hiding the focus.

What topics do this checkpoint affect?

  • Accessibility (See WCAG 2, 2.1.1, 2.1.3, 2.4.7, 3.2.1)

Can you explain how this checkpoint works?

This checkpoint will look for the following HTML Elements:

  • onfocus
  • onmouseout
  • onmouseup

The checkpoint will flag an issue if any of the attributes below are seen on the elements above:

  • hideFocus=true
  • blur()
  • style.outline=null
  • this.hideFocus=true
  • this.blur()
  • this.style.outline=null

References

F55: Failure of Success Criteria 2.1.1, 2.4.7, and 3.2.1 due to using script to remove focus when fo...

Labels (1)

Can't find what you are looking for?

Find Answers

Search our DQM Forum to find answers to questions asked by other DQM users.

Ask a Question

No luck? Ask a question. Our Product and Support teams are monitoring the Forum and typically respond within 48 hours.

Ask a Question