File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 58
58
import ModalRef from ' ../components/modals/ModalRef.svelte'
59
59
import type { Open , Callbacks , Component } from ' svelte-simple-modal'
60
60
import type { OnRenderContextMenu } from ' $lib/types.js'
61
+ import { cloneDeep } from ' lodash-es'
61
62
62
63
// TODO: document how to enable debugging in the readme: localStorage.debug="jsoneditor:*", then reload
63
64
const debug = createDebug (' jsoneditor:JSONEditor' )
89
90
90
91
export let onChangeQueryLanguage: OnChangeQueryLanguage = noop
91
92
export let onChange: OnChange = null
92
- export let onSelect: OnSelect = noop
93
+ export let onSelect: OnSelect | null = null
93
94
export let onRenderValue: OnRenderValue = renderValue
94
95
export let onClassName: OnClassName = () => undefined
95
96
export let onRenderMenu: OnRenderMenu = noop
288
289
function handleSelect(updatedSelection : JSONEditorSelection | null ) {
289
290
selection = updatedSelection
290
291
291
- onSelect (updatedSelection )
292
+ if (onSelect ) {
293
+ onSelect (cloneDeep (updatedSelection ))
294
+ }
292
295
}
293
296
294
297
function handleFocus() {
Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ export interface JSONEditorPropsOptional {
452
452
onRenderMenu ?: OnRenderMenu
453
453
onRenderContextMenu ?: OnRenderContextMenu
454
454
onChangeMode ?: OnChangeMode
455
+ onSelect ?: OnSelect
455
456
onError ?: OnError
456
457
onFocus ?: OnFocus
457
458
onBlur ?: OnBlur
You can’t perform that action at this time.
0 commit comments