From 1c063004436565abe8964121cb4461bc6e974ec8 Mon Sep 17 00:00:00 2001 From: josdejong Date: Tue, 2 Jun 2020 18:10:33 +0200 Subject: [PATCH] Remove `onChangeKey`, handle in child itself --- src/JSONEditor.svelte | 7 ------- src/JSONNode.svelte | 43 ++++++++---------------------------------- src/utils/syncState.js | 3 +++ 3 files changed, 11 insertions(+), 42 deletions(-) diff --git a/src/JSONEditor.svelte b/src/JSONEditor.svelte index 6bd1082..319fd5e 100644 --- a/src/JSONEditor.svelte +++ b/src/JSONEditor.svelte @@ -203,12 +203,6 @@ } } - - function handleChangeKey(key, oldKey) { - // console.log('handleChangeKey', { key, oldKey }) - // TODO: this should not happen? - } - function emitOnChange() { // TODO: add more logic here to emit onChange, onChangeJson, onChangeText, etc. onChangeJson(doc) @@ -361,7 +355,6 @@ path={[]} state={state} searchResult={searchResultWithActive} - onChangeKey={handleChangeKey} onPatch={handlePatch} onExpand={handleExpand} onLimit={handleLimit} diff --git a/src/JSONNode.svelte b/src/JSONNode.svelte index bcd5db2..a32f09a 100644 --- a/src/JSONNode.svelte +++ b/src/JSONNode.svelte @@ -1,5 +1,5 @@