Skip to content

Commit ae53f18

Browse files
authored
fix: normalize list point spacing when toggling RTL formatting (singerdmx#2745)
1 parent 760c092 commit ae53f18

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111
## [Unreleased]
1212

13+
### Fixed
14+
15+
- Fixed an issue where bullet points became visually detached from the text body when toggling text direction formatting (RTL) by locking the list leading block to the editor's base text direction.
16+
1317
### Removed
1418

1519
- Removed the already-`@Deprecated` and `@internal` `linkPrefixes` constant from the public API surface (it is hidden from the `flutter_quill.dart` export). Use `LinkValidator.linkPrefixes` instead.

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class _HomePageState extends State<HomePage> {
107107
config: QuillSimpleToolbarConfig(
108108
embedButtons: FlutterQuillEmbeds.toolbarButtons(),
109109
showClipboardPaste: true,
110+
showDirection: true,
110111
customButtons: [
111112
QuillToolbarCustomButtonOptions(
112113
icon: const Icon(Icons.add_alarm_rounded),

lib/src/editor/widgets/text/text_block.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,18 @@ class EditableTextBlock extends StatelessWidget {
177177
var index = 0;
178178
for (final line in Iterable.castFrom<dynamic, Line>(block.children)) {
179179
index++;
180+
final leading = _buildLeading(
181+
context: context,
182+
line: line,
183+
index: index,
184+
indentLevelCounts: indentLevelCounts,
185+
count: count,
186+
);
180187
final editableTextLine = EditableTextLine(
181188
line,
182-
_buildLeading(
183-
context: context,
184-
line: line,
185-
index: index,
186-
indentLevelCounts: indentLevelCounts,
187-
count: count,
188-
),
189+
leading != null
190+
? Directionality(textDirection: textDirection, child: leading)
191+
: null,
189192
TextLine(
190193
line: line,
191194
textDirection: textDirection,

0 commit comments

Comments
 (0)