Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
2db57b13
Commit
2db57b13
authored
Feb 02, 2026
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: handle pasted files in memo editor
Fixes #5568
parent
0dbc35a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
EditorContent.tsx
web/src/components/MemoEditor/components/EditorContent.tsx
+23
-2
No files found.
web/src/components/MemoEditor/components/EditorContent.tsx
View file @
2db57b13
...
...
@@ -29,8 +29,29 @@ export const EditorContent = forwardRef<EditorRefActions, EditorContentProps>(({
dispatch
(
actions
.
updateContent
(
content
));
};
const
handlePaste
=
()
=>
{
// Paste handling is managed by the Editor component internally
const
handlePaste
=
(
event
:
React
.
ClipboardEvent
<
Element
>
)
=>
{
const
clipboard
=
event
.
clipboardData
;
if
(
!
clipboard
)
return
;
const
files
:
File
[]
=
[];
if
(
clipboard
.
items
&&
clipboard
.
items
.
length
>
0
)
{
for
(
const
item
of
Array
.
from
(
clipboard
.
items
))
{
if
(
item
.
kind
!==
"file"
)
continue
;
const
file
=
item
.
getAsFile
();
if
(
file
)
files
.
push
(
file
);
}
}
else
if
(
clipboard
.
files
&&
clipboard
.
files
.
length
>
0
)
{
files
.
push
(...
Array
.
from
(
clipboard
.
files
));
}
if
(
files
.
length
===
0
)
return
;
const
localFiles
:
LocalFile
[]
=
files
.
map
((
file
)
=>
({
file
,
previewUrl
:
createBlobUrl
(
file
),
}));
localFiles
.
forEach
((
localFile
)
=>
dispatch
(
actions
.
addLocalFile
(
localFile
)));
event
.
preventDefault
();
};
return
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment