Fixed not removing selection before duplication
This commit is contained in:
parent
cb354f2331
commit
8cded5496c
|
@ -506,8 +506,9 @@ export default class TreeMode extends Component {
|
|||
const { data, selection, clipboard } = this.state
|
||||
|
||||
if (selection && clipboard && clipboard.length > 0) {
|
||||
// FIXME: handle pasting in an empty object or array
|
||||
this.setState({ selection: null })
|
||||
this.handlePatch(replace(data, selection, clipboard))
|
||||
// TODO: select the pasted contents
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -710,7 +711,7 @@ export default class TreeMode extends Component {
|
|||
const path = this.findDataPathFromElement(element)
|
||||
const area = element && element.getAttribute && element.getAttribute('data-area') || null
|
||||
|
||||
return { path, area }
|
||||
return path ? { path, area } : null
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -358,7 +358,7 @@ export function applySearchResults (eson: ESON, searchResults: ESONPointer[], ac
|
|||
* Merge searchResults into the eson object
|
||||
*/
|
||||
export function applySelection (eson: ESON, selection: ESONSelection) {
|
||||
if (!selection || !selection.start || !selection.end) {
|
||||
if (!selection) {
|
||||
return eson
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue