Skip to content

Image embeds: tap callback never fires, no clean way to intercept single taps #2628

@Gabianne01

Description

@Gabianne01

Have you checked for an existing issue?

Flutter Quill Version

11.4.2

Steps to Reproduce

  1. Create a QuillEditorImageEmbedConfig(onImageClicked: ...) or subclass with forceClick.

  2. Pass it into your editor via
    FlutterQuillEmbeds.editorBuilders(imageEmbedConfig: myConfig)

  3. Tap once on any image → nothing happens; keyboard shows or caret moves instead.

Expected results

On any normal tap (down→up within slop) on an image embed, or custom embed immediately invoke my callback, and do not let Quill move the caret.

Scrolling/drags when touching the image should continue to work naturally.

Actual results

Quick taps do not fire onImageClicked, or custom Embed onTap.

Long-press opens the default “image options” menu (but I need single-tap).

All hacks to intercept pointer events either break scrolling or still flash the keyboard.

Additional Context

Workarounds tried

  1. forceClick: true on QuillEditorImageEmbedConfig

  2. RawGestureDetector → swallowed by Quill

  3. Listener(onPointerDown)…cancelPointer → works, but breaks scroll

  4. Custom EmbedBuilder with

  • expanded: true
  • manually inserting leading/trailing newlines
  • wrapping my own GestureDetector/Listener around the image widget
  • → no onTap ever fires (or else listener breaks scrolling/keyboard)
  1. Delaying cancelPointer via Future.microtask → erratic behavior

Request / Questions

Is there any supported way to get a single-tap callback on an image embed? either built in or custom embed?

If not, can onImageClicked be wired to tapUp (not only long-press) on mobile by default?

Alternatively, would you consider exposing a skipKeyboardRequest flag so I can suppress the built-in focus/keyboard on a tap?

Thanks for any guidance or if you can point me toward a clean API for this use-case!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions