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

Quill editor overflows ConstrainedBox #1851

Open
1 task done
781flyingdutchman opened this issue May 8, 2024 · 4 comments
Open
1 task done

Quill editor overflows ConstrainedBox #1851

781flyingdutchman opened this issue May 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@781flyingdutchman
Copy link

Is there an existing issue for this?

Flutter Quill version

9.3.5

Steps to reproduce

I use the following widget to render the editor contents within a constrained box, within a Card. The Card shows that the contrainedBox is working: it grows with the contents up to the desired 300 height. The text from the editor however somehow overflows the sizedBox (to the bottom) and extends to the full length of the available text, well beyond the 300.

Card(child:
ConstrainedBox(
        constraints: const BoxConstraints(minHeight: 0, maxHeight: 300),
        child: QuillEditor.basic(
        focusNode: focusNode,
        scrollController: scrollController,
        configurations: QuillEditorConfigurations(
          scrollable: false,
          expands: false,
          controller: controller,
          sharedConfigurations:
              QuillSharedConfigurations(locale: Localizations.localeOf(context)),
        ),
      )
)

Expected results

Expect the editor to stay within the parent ConstrainedBox

Actual results

Editor overflows the ContrainedBox (and Card)

Code sample

Card(child:
ConstrainedBox(
        constraints: const BoxConstraints(minHeight: 0, maxHeight: 300),
        child: QuillEditor.basic(
        focusNode: focusNode,
        scrollController: scrollController,
        configurations: QuillEditorConfigurations(
          scrollable: false,
          expands: false,
          controller: controller,
          sharedConfigurations:
              QuillSharedConfigurations(locale: Localizations.localeOf(context)),
        ),
      )
)

Screenshots or Video

No response

Logs

No response

@781flyingdutchman 781flyingdutchman added the bug Something isn't working label May 8, 2024
@hoangsang17th
Copy link
Contributor

You can using maxHeigh, minHeight in QuillEditor alternative for ConstrainedBox
image

@781flyingdutchman
Copy link
Author

Thanks - it affects the height communicated to the parent (a Card widget in my case, which shrinks to the size set by maxHeight) but the actual text is still visible below the card, so this does not solve the problem. See screenshot
Screenshot from 2024-05-17 01-02-23

@hoangsang17th
Copy link
Contributor

That my mistake, with the new issue, u can wrapCard by a ClipRRect

@hoangsang17th
Copy link
Contributor

If still have issues, please comment with a mention of me

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