File tree 3 files changed +6
-8
lines changed
src/lib/components/modes/treemode
3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 64
64
}
65
65
</script >
66
66
67
- {#if isEditingKey }
67
+ {#if ! context . readOnly && isEditingKey }
68
68
<EditableDiv
69
69
value ={context .normalization .escapeValue (key )}
70
70
shortText
Original file line number Diff line number Diff line change 12
12
export let selection: JSONSelection | null
13
13
export let searchResultItems: SearchResultItem [] | undefined
14
14
15
- $ : isEditing = ! context . readOnly && isValueSelection (selection ) && isEditingSelection (selection )
15
+ $ : isEditing = isValueSelection (selection ) && isEditingSelection (selection )
16
16
17
17
$ : renderers = context .onRenderValue ({
18
18
path ,
Original file line number Diff line number Diff line change 1702
1702
1703
1703
if (combo === ' Enter' && documentState .selection ) {
1704
1704
// when the selection consists of a single Array item, change selection to editing its value
1705
- if (! readOnly && isMultiSelectionWithOneItem (documentState .selection )) {
1705
+ if (isMultiSelectionWithOneItem (documentState .selection )) {
1706
1706
const path = documentState .selection .focusPath
1707
1707
const parent = getIn (json , initial (path ))
1708
1708
if (Array .isArray (parent )) {
1711
1711
}
1712
1712
}
1713
1713
1714
- if (! readOnly && isKeySelection (documentState .selection )) {
1714
+ if (isKeySelection (documentState .selection )) {
1715
1715
// go to key edit mode
1716
1716
event .preventDefault ()
1717
1717
updateSelection ({ ... documentState .selection , edit: true })
1725
1725
// expand object/array
1726
1726
handleExpand (documentState .selection .path , true )
1727
1727
} else {
1728
- if (! readOnly ) {
1729
- // go to value edit mode
1730
- updateSelection ({ ... documentState .selection , edit: true })
1731
- }
1728
+ // go to value edit mode
1729
+ updateSelection ({ ... documentState .selection , edit: true })
1732
1730
}
1733
1731
}
1734
1732
}
You can’t perform that action at this time.
0 commit comments