Skip to content

[Accessibility] Semantics header property is ignored on Android #179678

@JJdeGroot

Description

@JJdeGroot

Steps to reproduce

  1. Create a text view, marked as header:
Semantics(
  header: true,
  child: Text('Descriptive header')
);
  1. Install on Android device
  2. Navigate to the text view using TalkBack

This commit: 59d8010 has changed the logic for setting the isHeading property.

result.setHeading(semanticsNode.hasFlag(Flag.IS_HEADER)); was replaced by result.setHeading(semanticsNode.headingLevel > 0); without a fallback.

Expected behavior would be to set isHeading to true if Flag.IS_HEADER OR headingLevel > 0.

Expected results

TalkBack should announce the text view as header.

Actual results

TalkBack does not announce is header.

Code sample

Semantics(
  header: true,
  child: Text('Descriptive header')
);

Screenshots or Video

The isHeading property is false in the accessibility tree.

Accessibility tree for Android app built in Flutter

Logs

N/A

Flutter Doctor output

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: regressionIt was better in the past than it is nowd: api docsIssues with https://api.flutter.dev/platform-androidAndroid applications specificallyteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions