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

Numbered list wrong numeration after increase + decrease indent #1974

Open
1 task done
Alspb opened this issue Jul 5, 2024 · 4 comments
Open
1 task done

Numbered list wrong numeration after increase + decrease indent #1974

Alspb opened this issue Jul 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Alspb
Copy link
Collaborator

Alspb commented Jul 5, 2024

Is there an existing issue for this?

Flutter Quill version

master

Steps to reproduce

  1. Increase the numbered list indent 3 times, until the numbering style is the same again.
  2. For the last list item decrease its indent 3 times.

Expected results

The last item numeration start from 1.

Actual results

The last item numeration start from 2.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

Numbered list numeration bug

Logs

Logs
[Paste your logs here]
@Alspb Alspb added the bug Something isn't working label Jul 5, 2024
@Alspb
Copy link
Collaborator Author

Alspb commented Jul 5, 2024

@AtlasAutocode , could you please take a look since you might be familiar with this code section?

@AtlasAutocode
Copy link
Collaborator

Part of the confusion might be that indents are limited to 5 levels (no idea why).
Ordered lists seem to have only 3 levels so it repeats the sequence.
When you indent 3 times you get back to '1.' However, this is not the same as the un-indented '1.'
So, the next outdented list item will be '2.'. That is correct (but not what you want!)

It appears that the first list item is implicitly set to 1 even if it is shown as an indented value.
For example: start a list and indent to give the first item 'a: text'. Enter another list item, outdent it and it will be '2. next'.

I am not familiar with the code, but I guess that there is an overlap between indentation of text and indentation of list items.
Am I correct that you want to create a normal list, but have it indented?

I see several approaches:

  1. Resolve the confusion between indentation and list-depth
  2. Have 5 levels of list indentation: 1, a, i, and then what?
  3. I am sure there will be some other way....

@Alspb
Copy link
Collaborator Author

Alspb commented Jul 7, 2024

lists indentation

Sounds reasonable.
Since list indentation is used to create nested lists, the editor thinks that there's an item number "1" before the "text" item.
But it looks strange of course, especially for the user who simply wants to use different numbering style for the first list (i.e., "text")

I think that the connection between list indentation and list depth is very useful, so it's better not to change it.
No sure what is the proper way of handling such issues. Maybe "text" item should also be unindented together with "next".

Also, delta to HTML converter treats such cases as if "text" is not indented too.

As for having 5 types of list numeration, I think it's reasonable anyway. One can take the same styles as in type attribute of the ol HTM tag, it will also make the conversion to HTML more precise.

@AtlasAutocode
Copy link
Collaborator

I was thinking that it might be more logical if indentation of the first item could be handled as an indentation of the whole list.
The first item would then always be '1.' and you would not be able to 'outdent' the second item. (Avoids the issue in your screen shot)
Indentation of subsequent items would then follow the expected pattern 'a', 'i' ...
Allowing the user to pick a different starting label would be tricky. But word processors allow starting a list at '4' (for example). I often have to do this when continuing a list after an interruption.

Of course, it is easy for me to suggest this, as I have no idea if this can be done...

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
None yet
Development

No branches or pull requests

2 participants