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

Prevent Pasting BlockEmbed.imageType with Ctrl + V on Desktop from Creating a Block #1905

Open
1 task done
sandapilarius opened this issue Jun 3, 2024 · 0 comments
Open
1 task done
Labels
help wanted Extra attention is needed

Comments

@sandapilarius
Copy link

Is there an existing issue for this?

The question

When attempting to paste using Ctrl + V on desktop, I want it to do nothing if it is BlockEmbed.imageType. Therefore, I created an EmbedBuilder as shown below, but it creates a line block. Is there a method that can do absolutely nothing without forcing the return of a Widget?

class ImageEmbedBuilder extends EmbedBuilder {
  @override
  String get key => BlockEmbed.imageType;

  @override
  bool get expanded => false;

  @override
  Widget build(
    BuildContext context,
    QuillController controller,
    Embed node,
    bool readOnly,
    bool inline,
    TextStyle textStyle,
  ) {
    return const SizedBox.shrink();
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant