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

Issue with Image Options in Quill Editor: "Embed node not found by offset" Error #2440

Open
1 task done
kaushikcrypticalinfo opened this issue Jan 16, 2025 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@kaushikcrypticalinfo
Copy link

kaushikcrypticalinfo commented Jan 16, 2025

Is there an existing issue for this?

Flutter Quill version

flutter_quill: ^10.8.5 dart_quill_delta: ^10.8.3 flutter_quill_extensions: ^10.8.5

Steps to reproduce

Steps to Reproduce

  1. Add the Quill editor to your Flutter project and integrate the flutter_quill_extensions package for image upload functionality.
  2. Add an image to the editor.
  3. Place the editor cursor somewhere in the text (not on the image).
  4. Click on the image to open the options menu (e.g., "Delete").
  5. Select an option like "Delete."

Expected results

The selected option (e.g., "Delete") should execute successfully, and the operation should work regardless of where the editor cursor is positioned.

Actual results

The operation fails, and the following error is thrown:

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Invalid argument(s): Embed node not found by offset
#0 getEmbedNode (package:flutter_quill/src/common/utils/embeds.dart:18:10)
#1 ImageOptionsMenu.build. (package:flutter_quill_extensions/src/editor/image/image_menu.dart:123:32)

Additional Context

  • The issue only occurs when the editor cursor is not positioned on the image. If the cursor is set @on the image, the options like "Delete" work correctly.
  • This seems to happen because the embed node for the image is not properly located when the cursor is elsewhere in the editor.

Custom Image Option Menus

If developers use custom image options menus, they should be able to manage this issue easily, based on the cursor position or by programmatically updating the editor's selection. However, the current behavior makes it difficult for developers to handle custom menus effectively.

This can create problems in scenarios where developers implement custom functionality for image options. A fix or documentation on how to handle custom implementations would be highly appreciated.

If needed, I can provide additional logs or screenshots.

@kaushikcrypticalinfo kaushikcrypticalinfo added the bug Something isn't working label Jan 16, 2025
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

1 participant