We'd like to set Google Analytics cookies to learn how people use the Knowledge Base, so we can improve it. We set them only if you accept.

Skip to main content
Digital Accessibility Knowledge Base

content-grouping

Mobile validation

Group elements that form one logical unit, so assistive technologies announce them together and in order.

When visual and text elements belong to one logical unit, such as a button made of an icon and a label, or a message made of a title and a body, group them. Assistive technologies can then move to the unit as a single item and announce its parts together, in the correct sequence. When the parts are not grouped, screen reader users reach them one at a time, as separate items. The content becomes fragmented, and its meaning or purpose may be unclear.

Note: This validation applies to Android only, including Flutter and React Native apps running on Android. There are no iOS examples.

Two versions of a Login button with a user icon. In the ungrouped version, the screen reader stops separately on the button, the user image, and the Login text. In the grouped version, it stops once and announces “User Login, button”.

Pass Patterns

Android

The container is focusable by screen readers, and its text views are not focusable, so they are announced together as one item.

XML
<LinearLayout
    android:id="@+id/messageContainer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:screenReaderFocusable="true">


    <TextView
        android:id="@+id/messageTitle"
        android:layout_width="..."
        android:layout_height="..."
        android:focusable="false"
        android:text="Title" />


    <TextView
        android:id="@+id/messageBody"
        android:layout_width="..."
        android:layout_height="..."
        android:focusable="false"
        android:text="Body" />
</LinearLayout>

Cross Platform

Flutter (Android)

The Semantics widget exposes the whole button as one item with a combined label, and excludeSemantics hides the separate texts.

Dart
Semantics(
  button: true,
  label: 'Title Body',
  onTap: openMessage,
  excludeSemantics: true,
  child: InkWell(
    onTap: openMessage,
    child: const Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Text('Title'),
        Text('Body'),
      ],
    ),
  ),
),

Fail Patterns

Android

The container is focusable, but its text views are also focusable, so screen readers stop on each part separately.

XML
<LinearLayout
    android:id="@+id/messageContainer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:screenReaderFocusable="true">


    <TextView
        android:id="@+id/messageTitle"
        android:layout_width="..."
        android:layout_height="..."
        android:focusable="true"
        android:text="Title" />


    <TextView
        android:id="@+id/messageBody"
        android:layout_width="..."
        android:layout_height="..."
        android:focusable="true"
        android:text="Body" />
</LinearLayout>

Cross Platform

Flutter (Android)

Each text is wrapped in its own Focus widget, so the parts of the button are reached separately.

Dart
Semantics(
  button: true,
  onTap: openMessage,
  child: InkWell(
    onTap: openMessage,
    child: const Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Focus(child: Text('Title')),
        Focus(child: Text('Body')),
      ],
    ),
  ),
),

Try It Yourself

Using a screen reader

New to screen reader testing, or need a refresher?
Review this article first: Practical guides for using screen readers

  1. Turn on TalkBack.
  2. Swipe right or left through the elements on the screen.
  3. Check whether the parts of each logical unit are announced together.

Expected results: Each logical unit is reached as a single item, and its parts are announced together, for example “User, Login, button”.

Actual results: The screen reader stops separately on parts of the same unit, such as an icon and its text.

FAQ

How does this issue relate to 1.3.2 Meaningful Sequence?

SC 1.3.2 requires that when the sequence of content affects its meaning, a correct reading sequence can be programmatically determined. Grouping the parts of a logical unit lets assistive technologies announce them together and in the intended order. When the parts are not grouped, users meet them separately, which can change the meaning or hide the relationship between them.

Why is this issue marked as Serious?

When related parts are announced as separate items, screen reader users may miss the context that connects them, misunderstand what a control does, or spend extra time piecing the content together. This slows tasks down and can lead to wrong actions, so it is rated serious.

Standards and Regulations

StandardSuccess CriterionReference
WCAG 2.21.3.2 Meaningful Sequence (A)When the sequence in which content is presented affects its meaning, a correct reading sequence can be programmatically determined.
EN 301 54911.1.3.2 Meaningful SequenceSame as the WCAG text.

Personas impacted by this issue

Learn More