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

Combination of styles numberList and text #1940

Open
1 task done
Leonardo1952 opened this issue Jun 21, 2024 · 1 comment
Open
1 task done

Combination of styles numberList and text #1940

Leonardo1952 opened this issue Jun 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Leonardo1952
Copy link

Is there an existing issue for this?

Flutter Quill version

9.4.4

Steps to reproduce

Create a normal text, then try to create a numbered list, the list will start to behave strangely.

Expected results

Make sure the spaces and numbering between items are correct.

Actual results

The numbers don't match and unnecessary spaces are added.

Code sample

Code sample
QuillToolbar.simple(
          configurations: QuillSimpleToolbarConfigurations(
            controller: controllerQuill,
            multiRowsDisplay: true,
            showAlignmentButtons: false,
            showSmallButton: false,
            showDirection: false,
            showLeftAlignment: false,
            showColorButton: false,
            showBackgroundColorButton: false,
            toolbarIconAlignment: WrapAlignment.start,
            toolbarIconCrossAlignment: WrapCrossAlignment.start,
            showFontFamily: false,
            showSubscript: false,
            showSuperscript: false,
            showFontSize: false,
            showDividers: false,
            showHeaderStyle: false,
            showListNumbers: true,
            showListBullets: false,
            showListCheck: false,
            showCodeBlock: false,
            showQuote: false,
            showStrikeThrough: false,
            showUnderLineButton: false,
            showIndent: false,
            showSearchButton: false,
            buttonOptions: QuillSimpleToolbarButtonOptions(
              bold: styleButtonOption(),
              italic: styleButtonOption(),
              underLine: styleButtonOption(),
              strikeThrough: styleButtonOption(),
              inlineCode: styleButtonOption(),
              subscript: styleButtonOption(),
              superscript: styleButtonOption(),
              small: styleButtonOption(),
              direction: styleButtonOption(),
              listNumbers: styleButtonOption(),
              listBullets: styleButtonOption(),
              quote: styleButtonOption(),
              clipboardCopy: styleButtonOption(),
              clipboardCut: styleButtonOption(),
              clipboardPaste: styleButtonOption(),
              codeBlock: QuillToolbarToggleStyleButtonOptions(
                iconData: FeatherIcons.terminal,
                iconTheme: iconTheme(),
              ),
              selectHeaderStyleButtons:
                  QuillToolbarSelectHeaderStyleButtonsOptions(
                      iconTheme: iconTheme()),
              selectHeaderStyleDropdownButton:
                  QuillToolbarSelectHeaderStyleDropdownButtonOptions(
                      iconTheme: iconTheme()),
              fontSize: QuillToolbarFontSizeButtonOptions(
                iconSize: PocketSizes.iconXSmall,
              ),
              search: QuillToolbarSearchButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              linkStyle: QuillToolbarLinkStyleButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              indentIncrease: QuillToolbarIndentButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              indentDecrease: QuillToolbarIndentButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              toggleCheckList: QuillToolbarToggleCheckListButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              selectAlignmentButtons: QuillToolbarSelectAlignmentButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              undoHistory: QuillToolbarHistoryButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              redoHistory: QuillToolbarHistoryButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
              clearFormat: QuillToolbarClearFormatButtonOptions(
                iconSize: PocketSizes.iconXSmall,
                iconTheme: iconTheme(),
              ),
            ),
            toolbarSectionSpacing: -0.9,
          ),
        ),```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

When combined with other texts
![Screenshot 2024-06-21 103438](https://github.com/singerdmx/flutter-quill/assets/53130191/e8ce8529-25b5-4e74-8b0f-640cf620826f)

Only using the numbered list
![Screenshot 2024-06-21 103523](https://github.com/singerdmx/flutter-quill/assets/53130191/d244cd10-f6ed-4f53-8c6b-f213631bce1a)


</details>


### Logs

<details><summary>Logs</summary>

```console
<p>Shopping list:</p><ol><li><br/></li><li><br/></li><li>orange</li><li>bean</li><li>banana</li><li>potato</li></ol><p><br/><br/></p>
@scolnet
Copy link

scolnet commented Jun 28, 2024

Hello Team,
With recent versions of flutter_quill (9.4.6, 9.4.7 on web or mobile) there is a regression with format delta document when using a block-level.

When you insert a simple text following by a list, blockquote or code-block, the delta generating by the editor is incorrect.
If display is OK with the editor, the html conversion is broken because you have some \n wrong inserted in document.

Example of generated delta :

[
   {
      "insert":"Text\n"
   },
   {
      "insert":"bullet1\n",
      "attributes":{
         "list":"ordered"
      }
   },
   {
      "insert":"bullet2"
   },
   {
      "insert":"\n",
      "attributes":{
         "list":"ordered"
      }
   },
   {
      "insert":"bullet3"
   },
   {
      "insert":"\n",
      "attributes":{
         "list":"ordered"
      }
   },
   {
      "insert":"bullet4"
   },
   {
      "insert":"\n",
      "attributes":{
         "list":"ordered"
      }
   },
   {
      "insert":"\n"
   }
]

The bullet1 don't respect delta format

So when using vcs_quill_delta_to_html, the html is wrong :

<p>Text</p><ol><li><br/></li><li><br/></li><li>bullet2</li><li>bullet3</li><li>bullet4</li></ol><p><br/></p>

The version of flutter_quill 8.6.4 used by the app example in vcs_quill_delta_to_html is ok :

[
  {
    "insert": "text\nbullet 1"
  },
  {
    "insert": "\n",
    "attributes": {
      "list": "ordered"
    }
  },
  {
    "insert": "bullet 2"
  },
  {
    "insert": "\n",
    "attributes": {
      "list": "ordered"
    }
  },
  ...
]

Do you confirm this ?

Thanks for your help

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