Skip to content

Commit

Permalink
fix: shift-click not working when selecting an area in between two nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Jan 8, 2022
1 parent a28bbdf commit c21f1f3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/lib/components/modes/treemode/JSONNode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -244,21 +244,31 @@
hover = null
}
function handleInsertInside() {
onSelect({ type: SELECTION_TYPE.INSIDE, path })
function handleInsertInside(event) {
if (!event.shiftKey) {
event.stopPropagation()
event.preventDefault()
onSelect({ type: SELECTION_TYPE.INSIDE, path })
}
}
function handleInsertAfter() {
onSelect({ type: SELECTION_TYPE.AFTER, path })
function handleInsertAfter(event) {
if (!event.shiftKey) {
event.stopPropagation()
event.preventDefault()
onSelect({ type: SELECTION_TYPE.AFTER, path })
}
}
function handleInsertInsideOpenContextMenu(event) {
handleInsertInside()
handleInsertInside(event)
onContextMenu(event)
}
function handleInsertAfterOpenContextMenu(event) {
handleInsertAfter()
handleInsertAfter(event)
onContextMenu(event)
}
Expand Down

0 comments on commit c21f1f3

Please sign in to comment.