Skip to content

Commit

Permalink
Fix MenuButtonImageUpload to respect insertImages prop
Browse files Browse the repository at this point in the history
A refactored version of
#188.
  • Loading branch information
sjdemartini committed Apr 18, 2024
1 parent 74bbaac commit 28468c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/controls/MenuButtonImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import type { Editor } from "@tiptap/core";
import { useRef, type ComponentPropsWithoutRef } from "react";
import type { SetOptional } from "type-fest";
import { useRichTextEditorContext } from "../context";
import { insertImages, type ImageNodeAttributes } from "../utils";
import {
insertImages as insertImagesDefault,
type ImageNodeAttributes,
} from "../utils";
import MenuButtonAddImage, {
type MenuButtonAddImageProps,
} from "./MenuButtonAddImage";
Expand Down Expand Up @@ -52,6 +55,7 @@ export interface MenuButtonImageUploadProps
export default function MenuButtonImageUpload({
onUploadFiles,
inputProps,
insertImages = insertImagesDefault,
...props
}: MenuButtonImageUploadProps) {
const editor = useRichTextEditorContext();
Expand Down

0 comments on commit 28468c0

Please sign in to comment.