Skip to content

Fix: a visual bug where bullet point spacing chagnes when toggling line-level directionality.#2745

Merged
Alspb merged 1 commit into
singerdmx:masterfrom
Alspb:fix/bullet-point-rtl-alignment
Jun 20, 2026
Merged

Fix: a visual bug where bullet point spacing chagnes when toggling line-level directionality.#2745
Alspb merged 1 commit into
singerdmx:masterfrom
Alspb:fix/bullet-point-rtl-alignment

Conversation

@Alspb

@Alspb Alspb commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes a visual bug where bullet point spacing chagnes when toggling line-level directionality.

The Problem:
In a standard LTR editor, when a line in an unordered list is toggled to RTL format, the visual space between the bullet point () and the actual text dramatically inflates.

The Solution:
Wrap Directionality around the layout's leading widget.

Before the fix:

Screenshot 2026-06-20 at 07 59 48

After the fix:

Screenshot 2026-06-20 at 07 57 39

Type of Change

  • Feature: New functionality without breaking existing features.
  • 🛠️ Bug fix: Resolves an issue without altering current behavior.
  • 🧹 Refactor: Code reorganization, no behavior change.
  • Breaking: Alters existing functionality and requires updates.
  • 🧪 Tests: New or modified tests
  • 📝 Documentation: Updates or additions to documentation.
  • 🗑️ Chore: Routine tasks, or maintenance.
  • Build configuration change: Build/configuration changes.

Copilot AI review requested due to automatic review settings June 20, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an RTL/LTR rendering edge case in list items by ensuring the list “leading” (e.g., bullet/number/checkbox) is laid out using the editor’s base TextDirection, preventing the marker-to-text gap from expanding when line-level directionality is toggled.

Changes:

  • Wrap the list leading widget in a Directionality set to the editor/base textDirection.
  • Refactor leading construction into a local variable for clearer conditional wrapping.
  • Update the example app toolbar to display the direction toggle button, and document the fix in the changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/src/editor/widgets/text/text_block.dart Locks list leading widgets to the editor’s base direction to keep marker spacing stable when a line toggles RTL/LTR.
example/lib/main.dart Enables the direction toggle in the example toolbar (showDirection: true).
CHANGELOG.md Adds an Unreleased “Fixed” entry describing the bullet spacing issue and resolution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Alspb Alspb merged commit ae53f18 into singerdmx:master Jun 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants