Skip to content

Commit

Permalink
fix: Disable Image Paste on Post Create (#1827)
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
RiXelanya authored May 15, 2023
1 parent f0f1236 commit 919d78e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/PostCreate/PostCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ export const PostCreate: React.FC<PostCreateProps> = props => {
setPost(prevPost => ({ ...prevPost, visibility }));
};

const handleImagePaste = event => {
if (event.clipboardData.getData('image') != '') {
event.preventDefault();
}
};

const handleSubmit = () => {
if (activeTab === 'import' && importUrl) {
onSubmit(importUrl, {
Expand Down Expand Up @@ -427,6 +433,7 @@ export const PostCreate: React.FC<PostCreateProps> = props => {
title={handleTitleModal().title}
subtitle={handleTitleModal().subtitle}
onClose={handleClose}
onPaste={handleImagePaste}
open={open}
fullScreen={isMobile}
maxWidth="md"
Expand Down

0 comments on commit 919d78e

Please # to comment.