Skip to content

Fix Chart Centering in RTL Layouts#19800

Merged
danharrin merged 4 commits intofilamentphp:4.xfrom
aymanalareqi:fix-chart-widgets-centering-in-rtl
May 2, 2026
Merged

Fix Chart Centering in RTL Layouts#19800
danharrin merged 4 commits intofilamentphp:4.xfrom
aymanalareqi:fix-chart-widgets-centering-in-rtl

Conversation

@aymanalareqi
Copy link
Copy Markdown
Contributor

This PR fixes an alignment issue where chart widgets were appearing incorrectly aligned to the right in RTL (Right-to-Left) layouts.

By applying @apply mx-auto flex w-full justify-center; to the .fi-wi-chart-canvas-ctn class, the chart container is now correctly centered across all text directions.

Visual changes

befor

Screenshot 2026-04-30 at 11 59 49 AM

after

Screenshot 2026-04-30 at 12 00 18 PM

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@github-project-automation github-project-automation Bot moved this to Todo in Roadmap May 1, 2026
@danharrin danharrin added bug Something isn't working needs more info labels May 1, 2026
@danharrin danharrin modified the milestone: v4 May 1, 2026
Copy link
Copy Markdown
Member

@danharrin danharrin left a comment

Choose a reason for hiding this comment

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

Please attach a reproduction repository for this problem, as I cannot reproduce it locally, and these changes seem to be too broad for just the RTL fix

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Roadmap May 1, 2026
@aymanalareqi
Copy link
Copy Markdown
Contributor Author

Please attach a reproduction repository for this problem, as I cannot reproduce it locally, and these changes seem to be too broad for just the RTL fix

Hi @danharrin,

I have created a reproduction repository here: https://github.com/aymanalareqi/chart_widgets_issue

This project includes all chart widget types on the dashboard. I have set the default locale to ar in the environment to force RTL mode. You will observe that the charts are misaligned/not centered in RTL, while they remain perfectly centered if you switch the locale back to en.

I hope this helps in isolating the issue and finding a more targeted CSS fix.

Thanks!

@aymanalareqi aymanalareqi requested a review from danharrin May 1, 2026 18:36
@danharrin
Copy link
Copy Markdown
Member

I can't reproduce the issue with your repository, what browser and OS are you using?

Screenshot 2026-05-02 at 08 37 24

@aymanalareqi
Copy link
Copy Markdown
Contributor Author

I can't reproduce the issue with your repository, what browser and OS are you using?

Screenshot 2026-05-02 at 08 37 24

I'm testing on macOS Taheo 26.2 with Safari Version 26.2

@danharrin
Copy link
Copy Markdown
Member

Seems like a Safari-only issue

@danharrin danharrin merged commit a7304d8 into filamentphp:4.x May 2, 2026
23 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Roadmap May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants