From 919d78e4cc9b7cb66284096a9c03556d5b76a407 Mon Sep 17 00:00:00 2001 From: RXRD <118821868+RiXelanya@users.noreply.github.com> Date: Mon, 15 May 2023 13:17:22 +0700 Subject: [PATCH] fix: Disable Image Paste on Post Create (#1827) Add files via upload --- src/components/PostCreate/PostCreate.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/PostCreate/PostCreate.tsx b/src/components/PostCreate/PostCreate.tsx index 5cda3af1f..28b5db480 100644 --- a/src/components/PostCreate/PostCreate.tsx +++ b/src/components/PostCreate/PostCreate.tsx @@ -136,6 +136,12 @@ export const PostCreate: React.FC = props => { setPost(prevPost => ({ ...prevPost, visibility })); }; + const handleImagePaste = event => { + if (event.clipboardData.getData('image') != '') { + event.preventDefault(); + } + }; + const handleSubmit = () => { if (activeTab === 'import' && importUrl) { onSubmit(importUrl, { @@ -427,6 +433,7 @@ export const PostCreate: React.FC = props => { title={handleTitleModal().title} subtitle={handleTitleModal().subtitle} onClose={handleClose} + onPaste={handleImagePaste} open={open} fullScreen={isMobile} maxWidth="md"