Inappropriate Focus Blur Check

RuleSets of AccessMonitor - the validator of web accessibility practices

Inappropriate Focus Blur Check

Description

The “Inappropriate Focus Blur Check” evaluates whether there is any JavaScript code used to remove focus from a field (e.g., using element.blur()) when that field is focused.

Example outcome

I found 1 case where javascript is used to remove the focus from the field, whenever the field receives the focus.

Impact

Fixes

To address inappropriately removed focus from a field by javascript code:

  1. Remove any JavaScript code that intentionally triggers element.blur() or similar methods on focus. These scripts violate user expectations and accessibility requirements.
  2. Locate the element that had the focus removed from it by the javascript.
  3. To obtain a similar behaviour using an accessible variant, try some of these alternatives:
  4. Use disabled or readonly for non-editable fields.
  5. Explain via ARIA and visible instructions if interaction is limited.
  6. Use tabindex="-1" only when you do not want the element in the tab order, not to remove focus once it’s received.

Resources