diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index e8c09f65..876de0c0 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -455,12 +455,19 @@ class NoteList extends React.Component { } handleDragStart (e, note) { - const { selectedNoteKeys } = this.state + let { selectedNoteKeys } = this.state + const noteKey = getNoteKey(note) + + if (!selectedNoteKeys.includes(noteKey)) { + selectedNoteKeys = [] + selectedNoteKeys.push(noteKey) + } + const notes = this.notes.map((note) => Object.assign({}, note)) const selectedNotes = findNotesByKeys(notes, selectedNoteKeys) const noteData = JSON.stringify(selectedNotes) e.dataTransfer.setData('note', noteData) - this.setState({ selectedNoteKeys: [] }) + this.selectNextNote() } handleNoteContextMenu (e, uniqueKey) {