Prefer 'disabledFocusable' over 'disabled' when component has loading state to maintain keyboard navigation accessibility #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add accessibility rule: prefer-disabledfocusable-over-disabled for loading states
Summary
Implements a new ESLint rule that encourages the use of
disabledFocusableoverdisabledwhen FluentUI components are in loading states to maintain keyboard navigation accessibility.Problem Statement
When components are disabled during loading states using the
disabledprop, 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
disabledand loading state props (e.g.,loading,isLoading,pending) and suggests usingdisabledFocusableinstead. ThedisabledFocusableprop maintains the component in the tab order while conveying the disabled state viaaria-disabled="true".Rule Details
prefer-disabledfocusable-over-disabledKey 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