Skip to content

Accessibility Issue in RichText: Keyboard focus is getting trapped inside Theme color section of Font Color due to which Automatic control not accessible using Shift-Tab key as well as Standard color is not accessible using Tab key same issue with Highlighted color control is getting trapped with tab key and not accessible using "Shift-Tab" #1944

Open

Description

@shashankpatel1542

User Experience:
Users who depend on keyboard will be impacted if "Automatic" control is not accessible using "Shift-Tab" key after you move inside Theme color picker or Standard Color picker. Keyboard functions and people that are blind or have low vision and people that use keyboard emulators cannot access the content which will confuse them.

Please Note: Standard Color picker is not accessible with pressing tab or arrow key at all.

Actual Result:
"Automatic" control is not accessible using "Shift-Tab" key upon navigating inside Theme color to pick a color.
Issue Reproduce for "No Color" control inside "Highlight color" button of the same dialog.

Expected Result:
"Automatic" control should be accessible using "Shift-Tab" key once you navigate inside Theme color/Standard color.

Image

We observed the focus is getting trapped once you tab inside the theme color and it won't allow to come out of it due to that standard colors section also not accessible for keyboard users

Same issue for Highlighted color as well see attached screenshot, once you go inside color picker you wont able to come back outside using Shift-tab key.

Image

Activity

  1. changed the title [-]Accessibility Issue: Keyboard focus is getting trapped inside Theme color section of Font Color and Highlighted color due to which control is not accessible using "Shift-Tab"[/-] [+]Accessibility Issue in RichText: Keyboard focus is getting trapped inside Theme color section of Font Color and Highlighted color due to which control is not accessible using "Shift-Tab"[/+] on Jan 23, 2025
  2. changed the title [-]Accessibility Issue in RichText: Keyboard focus is getting trapped inside Theme color section of Font Color and Highlighted color due to which control is not accessible using "Shift-Tab"[/-] [+]Accessibility Issue in RichText: Keyboard focus is getting trapped inside Theme color section of Font Color due to which Automatic control not accessible using Shift-Tab key as well as Standard color is not accessible using Tab key same issue with Highlighted color control is getting trapped with tab key and not accessible using "Shift-Tab"[/+] on Feb 19, 2025
  3. spaulah commented on Nov 21, 2026

    @spaulah

    Hi @michaelmaillot
    I'd like to pick this one up. I reproduced it on dev (7646538) with a small unit test.

    Repro test (jest + enzyme, fails on dev)
    it('lets Tab on the last swatch leave the group (#1944)', () => {
      const all = swatches();
      const last = all[all.length - 1];
      last.focus();
      const preventDefault = jest.fn();
      wrapper.find('button').filterWhere(b => b.prop('id') === last.id)
        .simulate('keydown', { which: KeyCodes.tab, keyCode: KeyCodes.tab, key: 'Tab', preventDefault });
    
      expect(document.activeElement.id).to.equal(last.id);   // fails: focus wrapped to the first swatch
      expect(preventDefault.mock.calls.length).to.equal(0);  // fails: the group took the Tab key
    });

    (Shift-Tab on the first swatch fails the same way: focus wraps to the last swatch.)

    Based on my tests, what's happing is that each color group in SwatchColorPickerGroup is a FocusZone with
    handleTabKey={FocusZoneTabbableElements.all} and isCircularNavigation
    (L17-L19).
    The zone takes Tab/Shift-Tab and wraps them inside the group, so focus can't get back to "Automatic"/"No Color" or
    move on to "Standard Colors". Font Color and Highlight color share this component.

    Proposed fix: remove handleTabKey so the zone uses its default. Each group then becomes a single Tab stop:
    Tab/Shift-Tab move between the default button and the groups, and the arrow keys move between swatches inside a group
    (still circular). Optionally I can also switch the zone to bidirectional so Up/Down move between the swatch rows.
    I'd leave #1942/#1943 for separate PRs.

    Happy to open a PR with this approach if that works for you.

  4. michaelmaillot commented on Nov 23, 2026

    @michaelmaillot
    Collaborator

    Hello @spaulah,

    It's all yours!

  5. added
    status:working-on-it
    and removed on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status:working-on-ittype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions