singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.58k stars 835 forks source link

ImageOptionsMenu causes error if the image dimensions are greater than the users screensize. #2248

Open CoreySafetyIndicators opened 1 month ago

CoreySafetyIndicators commented 1 month ago

Is there an existing issue for this?

Flutter Quill version

9.3.4

Steps to reproduce

Setup: On web, have your browser maximized. Get an image that is the same resolution as your monitor.

  1. Click the insert image button in the Quill Editor.
  2. Select the image from the setup phase.
  3. Click on the image and select resize.
  4. Resize the image to the maximum size allowed.
  5. Click away so that the dialog goes away.
  6. Resize the window to a smaller size.
  7. Click on the image again and select resize.
  8. The error below will popup. This happens because the max size allowed in the slider is restricted to the screen size. image

Expected results

An error should not appear and the max should be set to the max image size if greater than the screen size.

Actual results

The following error will appear whenever the screen is resized. This is critical when saving an image that could be opened on different sized screens. image

Code sample

Code sample ```dart QuillEditor.basic( configurations: QuillEditorConfigurations( controller: quillPrefilledController, embedBuilders: kIsWeb ? FlutterQuillEmbeds.editorWebBuilders() : FlutterQuillEmbeds.editorBuilders(), minHeight: quillEditorMinHeight, maxHeight: double.infinity, padding: const EdgeInsets.all(4.0), expands: false, ), ); ```

Additional Context

Screenshots / Video demonstration [Upload media here]
Logs ```console [Paste your logs here] ```
EchoEllet commented 1 month ago

Can you try the latest version? 10.6.0 or newer versions?

CoreySafetyIndicators commented 1 month ago

We are waiting for one more of out dependencies to upgrade to using Web 1.0. Once that is done, I can try it. I did look a the source code in the latest version and there didn't appear to be any changes to this file.

CoreySafetyIndicators commented 1 month ago

I tested this on 10.7.5 and was still able reproduce this issue.