Skip to content

Commit

Permalink
use PDI to end the isolated scope for RLI (#141345)
Browse files Browse the repository at this point in the history
  • Loading branch information
kseino authored Jan 30, 2024
1 parent abebd34 commit 9ed650a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/widgets/semantics_debugger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class _SemanticsDebuggerPainter extends CustomPainter {
} else {
switch (data.textDirection!) {
case TextDirection.rtl:
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDF}';
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDI}';
case TextDirection.ltr:
effectivelabel = tooltipAndLabel;
}
Expand Down
21 changes: 21 additions & 0 deletions packages/flutter/test/widgets/semantics_debugger_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,27 @@ void main() {
// ignore: avoid_dynamic_calls
expect(_getSemanticsDebuggerPainter(debuggerKey: debugger, tester: tester).labelStyle, labelStyle);
});

testWidgets('SemanticsDebugger label for rtl.', (WidgetTester tester) async {
final UniqueKey debugger = UniqueKey();
final Key label = UniqueKey();

await tester.pumpWidget(
Directionality(
textDirection: TextDirection.rtl,
child: SemanticsDebugger(
key: debugger,
child: Semantics(
label: 'ملصق',
textDirection: TextDirection.rtl,
key: label,
),
),
),
);

expect(_getMessageShownInSemanticsDebugger(widgetKey: label, debuggerKey: debugger, tester: tester), '\u2067ملصق\u2069');
});
}

String _getMessageShownInSemanticsDebugger({
Expand Down

0 comments on commit 9ed650a

Please sign in to comment.