Skip to content

Conversation

@sidhsharma1992
Copy link
Collaborator

@sidhsharma1992 sidhsharma1992 commented Sep 18, 2025

Add accessibility rule: prefer-disabledfocusable-over-disabled for loading states

Summary

Implements a new ESLint rule that encourages the use of disabledFocusable over disabled when FluentUI components are in loading states to maintain keyboard navigation accessibility.

Problem Statement

When components are disabled during loading states using the disabled prop, they are completely removed from the keyboard tab order (tabindex="-1"). This creates accessibility barriers for keyboard and screen reader users who cannot discover or navigate to these temporarily unavailable components.

Solution

This rule detects when components have both disabled and loading state props (e.g., loading, isLoading, pending) and suggests using disabledFocusable instead. The disabledFocusable prop maintains the component in the tab order while conveying the disabled state via aria-disabled="true".

Rule Details

  • Rule Name: prefer-disabledfocusable-over-disabled
  • Type: Suggestion (warns in recommended config)
  • Fixable: Yes (automatic fixes available)
  • Target Components: Button, ToggleButton, CompoundButton, MenuButton, SplitButton, Checkbox, Radio, Switch, Input, Textarea, Combobox, Dropdown, SpinButton, Slider, DatePicker, TimePicker, Link, Tab

Key Features

Smart Detection: Identifies multiple loading state patterns (loading, isLoading, pending, isPending, busy, isBusy)
Conflict Avoidance: Doesn't trigger when both props are already present
Automatic Fixes: Preserves original prop values and expressions
Comprehensive Testing: Covers all applicable components and edge cases
Clear Documentation: Detailed examples and accessibility guidance

@aubreyquinn aubreyquinn merged commit 0a8a70e into main Sep 18, 2025
9 of 11 checks passed
@aubreyquinn aubreyquinn deleted the users/sidhshar/feature-prefer-disabledfocusable--with-loading-state branch September 18, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Accessibility Rule: prefer disabledFocusable for components with loading state

3 participants