-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
f: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.platform-webWeb applications specificallyWeb applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight
Milestone
Description
If I have nested TextSpans in a RichText widget, adding a GestureRecognizer to the top level TextSpan will work fine, but adding one to a nested TextSpan will not. This is only an issue with Flutter for web, not standard Flutter.
This works:
RichText(
text: TextSpan(
text: 'TOP',
recognizer: TapGestureRecognizer()..onTap = _incrementCounter,
children: <TextSpan>[
TextSpan(
text: 'CHILD',
// recognizer: TapGestureRecognizer()..onTap = _incrementCounter,
),
],
),
),This does not:
RichText(
text: TextSpan(
text: 'TOP',
// recognizer: TapGestureRecognizer()..onTap = _incrementCounter,
children: <TextSpan>[
TextSpan(
text: 'CHILD',
recognizer: TapGestureRecognizer()..onTap = _incrementCounter,
),
],
),
),If both are present, the parent will win (I assume this is intended behaviour).
My use-case is nested spans to be able to colour separators in a slide credit, where I need different links. Or maybe I don't understand how best to work with RichText and TextSpan for something like this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
f: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.platform-webWeb applications specificallyWeb applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight
