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;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3348933-after-patch.png | 311.53 KB | nayana_mvr |
| #5 | 3348933-before-patch.png | 318.65 KB | nayana_mvr |
| Screenshot from 2023-03-19 17-27-17.png | 127.57 KB | yoa |
Issue fork gin-3348933
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
Comment #4
saschaeggiOh thanks for reporting. Please review the MR 🙇
Comment #5
nayana_mvr commentedVerified 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.
Comment #6
yoaHey! 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 =)
Comment #7
indrajithkb commentedAccording 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.
Comment #9
saschaeggiGreat, thanks for reporting & testing 🙇