Entity diagram focus order seems random

Created on 1 March 2023, over 1 year ago
Updated 18 March 2024, 3 months ago

Problem/Motivation

WCAG 2.4.7: The focus order seems random within the content model. I would have thought it would try to more closely follow reading order - left to right, up and down. This could be confusing for someone using assistive technologies but is also a sighted user.
For Landing page, focus jumps around quite a bit - Landing Page node > Sections Taxonomy_term > Rich text paragraph > List of links paragraph, etc.
For the Benefits Hub Landing page, after the main Benefits Hub landing page node, focus goes through all the bottom items first (Sections taxonomy_term through Support Service node) then the top items (Checklist node through Contact information paragraph)

Steps to reproduce

Go to an entity diagram and tab through it.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States swirt Florida

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

  • Issue created by @swirt
  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida

    Given the nature of Mermaid and how the order does not change the diagram, this may not be fixable. Will need more investigation.

  • πŸ‡ΊπŸ‡ΈUnited States beeyayjay

    Elements are added using a breadth-first search, first for referenced entities and then for referencing entities. So the order is:

    1. Starting element
    2. All children of starting element (elements referenced in starting element)
    3. All children of first child, all children of second child, etc. to selected depth
    4. All parents of starting element (elements that reference the starting element)
    5. All parents of first parent, all parents of second parent, etc. to selected depth

    Mermaid uses that order, but uses it's own logic to place elements on the screen, apparently with the intention of minimizing crossed connecting lines. It appears that when only one level is shown (direct children or direct parents), the focus starts with the left-most element on the screen and continues to the right as expected, but with more levels and more complex interconnections, Mermaid rearranges the elements, so focus often jumps around.

    This means we can affect some aspects of the focus order by changing the way related elements are added. We could put parent elements (which appear above the starting element) first. We could also use a depth-first search, so, after the first child of the starting element, the focus would move to the first child of that child, and so on until the depth is reached or there are no more children.

    I don't know if either of those options are preferable to what we have now. Neither would resolve the problem of focus jumping around the screen.

  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida
  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida

    I am moving this issue to the mermaid_diagram_field module because that no covers the use of the Mermaid library and rendering.

    Ultimately I think this is a limitation of the Mermaid library itself as the ordering is not anything that can be solved in this module at this time.

  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida
Production build 0.69.0 2024