Skip to content

Semantics assertion node.isMergedIntoParent when a sibling merge group is produced inside MergeSemantics #191095

Closed

Description

@Pante

Found while migrating Forui from 3.44+ to 3.47. It surfaced as roughly 200 failing widget tests across every widget that puts a text field inside a merged subtree.

Edit:
This seems to be quite a bad regression since simply passing a prefix to material's TextField, then tapping it is also enough to trigger the assertion.

Steps to reproduce

Run the widget test in the code sample below.

  1. a MergeSemantics ancestor
  2. a descendant whose SemanticsConfiguration.childConfigurationsDelegate produces a sibling merge
    group. InputDecorator has one. It routes through _AffixText, which sits under an AnimatedOpacity.

Expected results

No assertion. The sibling node is merged into the enclosing merge root.

Actual results

'package:flutter/src/semantics/semantics.dart': Failed assertion: line 3862 pos 16:
'node.isMergedIntoParent': is not true.

Code sample

Code sample
import 'package:material_ui/material_ui.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets('MergeSemantics + sibling merge group', (tester) async {
    final focus = FocusNode();
    addTearDown(focus.dispose);

    await tester.pumpWidget(
      MaterialApp(
        home: Material(
          child: MergeSemantics(
            child: TextField(
              focusNode: focus,
              decoration: const InputDecoration(prefix: SizedBox(width: 12)),
            ),
          ),
        ),
      ),
    );

    focus.requestFocus();
    await tester.pumpAndSettle();

    expect(tester.takeException(), isNull);
  });
}

Potential fix

The sibling node needs to account for the merge it is about to be placed inside, not only the one
imposed from above:

--- a/packages/flutter/lib/src/rendering/object.dart
+++ b/packages/flutter/lib/src/rendering/object.dart
@@ class _RenderObjectSemantics extends _SemanticsFragment with DiagnosticableTreeM
-        node.isMergedIntoParent = parentData?.mergeIntoParent ?? false;
+        node.isMergedIntoParent =
+            configProvider.effective.isMergingSemanticsOfDescendants ||
+            (parentData?.mergeIntoParent ?? false);

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.47.0, on macOS 26.6.1 25G76 darwin-arm64, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.6)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Activity

  1. suryaKommana2662 commented on Aug 14, 2026

    @suryaKommana2662
    Contributor

    @Pante Thanks for the report an issue. I able to reproduce the issue locally using the provided minimal test case. The test passes on Flutter 3.44.8, but the issue is reproducible on Flutter 3.47.0, where it fails with the same assertion:

    'package:flutter/src/semantics/semantics.dart':
    Failed assertion: line 3862 pos 16:
    'node.isMergedIntoParent': is not true.
    

    This appears to be a regression between Flutter 3.44.8 and 3.47.0. Routing to the team-accessibility for further investigation.

  2. added
    c: regressionIt was better in the past than it is now
    frameworkflutter/packages/flutter repository. See also f: labels.
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    and removed
    in triagePresently being triaged by the triage team
    on Aug 14, 2026
  3. self-assigned this
    on Aug 19, 2026
  4. added
    P2Important issues not at the top of the work list
    on Aug 19, 2026
  5. Pante commented on Aug 20, 2026

    @Pante
    ContributorAuthor

    Hi @chunhtai, thanks for triaging this!

    May I know if there's a rough timeline for a fix? No pressure for an exact date/timeline, asking because this currently blocks Forui's migration to 3.47. Knowing roughly when this might land (and whether it could be a candidate for a cherry-pick into a hotfix release, given it's a regression) will really help us decide how to handle this on our side. Thanks again!

  6. chunhtai commented on Aug 21, 2026

    @chunhtai
    Contributor

    soon

  7. github-actions commented on Sep 17, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: regressionIt was better in the past than it is nowfound in release: 3.47Found to occur in 3.47frameworkflutter/packages/flutter repository. See also f: labels.team-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