Skip to content

Path breadcrumb buttons receive focus before the path links (WCAG 2.4.3 Focus Order) #19861

Todo

Description

@gtritchie

In the path breadcrumb shown in file dialogs and in the Files pane, keyboard focus reaches the "Go to project directory" and "Go to directory" ("...") buttons before the breadcrumb's path links, although the buttons are at the right end of the bar. The tab order doesn't follow the visual left-to-right order, which fails WCAG 2.2 SC 2.4.3 Focus Order (Level A).

Steps to reproduce

File dialogs (RStudio Server, or Desktop with native file dialogs turned off):

  1. Open a project, so the "Go to project directory" button shows.
  2. Choose File > Open File.
  3. From the File name box, press Tab repeatedly.

Focus moves to "Go to project directory", then "Go to directory", and only then to the path links, from left to right. Expected: the path links first, then the two buttons.

Files pane: from the "Select all files" checkbox, Tab reaches the same two buttons before the path links:

Go to project directory  [button]
Go to directory          [button]
~                        [link]
~/a-scratch              [link]
~/a-scratch/quartopub    [link]

Cause

PathBreadcrumbWidget lays out the bar with a DockLayoutPanel: the buttons are added with addEast(), and the path, the center widget, is added last. GWT requires that order ("No widget may be added after the CENTER widget"), so the buttons' container always comes first in the DOM. The panel positions each part absolutely, so the DOM order doesn't show on screen, but it sets the tab order.

Possible fix

Lay the bar out as a flex row instead, with the path first (taking the remaining width) and the buttons after it. The DOM order then matches the visual order. This would also remove the need to set the button area's width from Java, including the forceLayout() that makes the path scroll to its end after the project button is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions