Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List layout bug in RTL mode #1498

Closed
amitm02 opened this issue Jun 7, 2017 · 3 comments
Closed

List layout bug in RTL mode #1498

amitm02 opened this issue Jun 7, 2017 · 3 comments

Comments

@amitm02
Copy link

amitm02 commented Jun 7, 2017

Steps for Reproduction

Create numbered list with text in RTL mode. see for example: Quill example

Expected behavior:
Wrap lines should start after the numbered index position, right below the first letter of the list item. see example of native css: CSS example

Actual behavior:

English text works fine. But with Hebrew text (RTL mode), the wrap line text starts under the list item index number. Quill example

Platforms:

Chrome & Safari

Version:
1.2.6

@benbro
Copy link
Contributor

benbro commented Jun 7, 2017

Need to decrease the window width to cause the lines to wrap and see the issue.

This fixes the indentation but it's not possible to style the ol element based on ql-direction-rtl class in the li child.

.ql-editor ol, .ql-editor ul {
    padding-right: 1.5em;
}

.ql-editor li.ql-direction-rtl::before {
    margin-right: -1.5em;
}

@jhchen why do we need padding on the ol element and negative margin on the li element?
Removing both doesn't seem to change the layout but fixes the rtl issue.

.ql-editor ol, .ql-editor ul {
    padding-left: 1.5em;
}

.ql-editor li::before {
    margin-left: -1.5em;
}

@jhchen jhchen closed this as completed in 67cd065 Jun 8, 2017
@jhchen
Copy link
Member

jhchen commented Jun 8, 2017

I believe the padding is due to two reasons:

  1. Users like some space between the numbers and the left boundary of the page
  2. Aligns with indents/tabs that are not lists

The negative margin left makes the aligning easier to implement with variable with numbers, since you want to right align the numbers themselves in left aligned text. I believe 67cd065 fixes the issue. Let me know if it doesn't work.

@benbro
Copy link
Contributor

benbro commented Jun 8, 2017

Your fix works great.
Thanks.

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

No branches or pull requests

3 participants