Problem/Motivation

In the newest release RC2: Modal dialog in RTL is sticking to the right side of the screen.

Steps to reproduce

Clean installation of Drupal 10 with Gin.
Install Language and set any RTL language as default.
Open a modal.

Proposed resolution

The issue is with this css

    .ui-dialog {
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--gin-font);
    outline: none;

After compiling with postcssRTLCSS we are getting

    [dir="rtl"] .ui-dialog {
    right: 0;
    }

while Core's dialog.position.js is adding position value to the left property.

In LTR the modal's style overrides the css and the modal is centered, but in RTL the right: 0 property is problematic with the left: x style property.

I am not really how to solve it.
This initial value seems to also affect to JS calculation (we get left: 0), So I think that even if you do something like this

[dir="rtl"] .ui-dialog:not([style]) {
    right: 0;
}

It would result in left: 0.

Why does gin to set it to 0? just as an inital settings until JS runs?

Perhaps it's a core issue? Because left should be right in RTL.

In anycase quick-fix for anyone is struggling with this until this issue is solved, you can just add this to your css.

[dir="rtl"] .ui-dialog {
    right: unset;
}

Issue fork gin-3348933

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Yoa created an issue. See original summary.

saschaeggi made their first commit to this issue’s fork.

saschaeggi’s picture

Status: Active » Needs review

Oh thanks for reporting. Please review the MR 🙇

nayana_mvr’s picture

StatusFileSize
new318.65 KB
new311.53 KB

Verified the MR!238 on Drupal version 10.1.x and Gin Admin Theme version 8.x-3.x. The patch applied cleanly and tested it with media modal dialog box. Now the modal box is fixed in the centre and I have added the before and after screenshots for reference. Need RTBC+1.

yoa’s picture

Hey! thanks!
I confirm the patch fixes the issue on RC2 of gin with 9.5.5 Drupal. (I also checked that nothing breaks in LTR =)

indrajithkb’s picture

Status: Needs review » Reviewed & tested by the community

According to the above comments changing the status to RTBC for quick fix of the issue, So @saschaeggi now it's good to go and merge your MR.

Thanks @nayana_mvr and @Yoa for the review.

saschaeggi’s picture

Status: Reviewed & tested by the community » Fixed

Great, thanks for reporting & testing 🙇

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.