mirror of
https://github.com/block/buzz.git
synced 2026-10-29 05:21:31 +00:00
fix(mobile): wrap exact mention chips at accessible text sizes
Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
@@ -940,7 +940,9 @@ class _MentionPill extends StatelessWidget {
|
||||
offset: const Offset(0, -Grid.quarter),
|
||||
child: Text('@', style: style),
|
||||
),
|
||||
Text(label, style: style, semanticsLabel: semanticsLabel),
|
||||
Flexible(
|
||||
child: Text(label, style: style, semanticsLabel: semanticsLabel),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:buzz/features/channels/message_content.dart';
|
||||
import '../../helpers/widget_helpers.dart';
|
||||
@@ -20,6 +21,27 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('qualified chips wrap in narrow layouts at large text sizes', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(320, 640);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
WidgetHelpers.testable(
|
||||
child: MediaQuery(
|
||||
data: const MediaQueryData(textScaler: TextScaler.linear(2)),
|
||||
child: MessageContent(
|
||||
content: '@Scout (${'b' * 64})',
|
||||
mentionNames: {'b' * 64: 'Scout'},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('namesake chips resolve exact tagged keys, not tag order', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user