Skip to content

Commit

Permalink
fix: start typing in an empty document in tree mode throwing an error
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Jun 8, 2023
1 parent aeb5d8f commit 747f2b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/logic/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export function onInsert({
onReplaceJson(newValue, (patchedJson, patchedState) => ({
state: {
...expandRecursive(patchedJson, patchedState, path),
selection: createInsideSelection(path)
selection: createValueSelection(path, true)
}
}))
}
Expand Down Expand Up @@ -655,6 +655,7 @@ export async function onInsertCharacter({
// a patch to change the object/array into a value)
}
} else {
debug('onInsertValueWithCharacter', { char })
await onInsertValueWithCharacter({
char,
refJsonEditor,
Expand Down

0 comments on commit 747f2b4

Please sign in to comment.