Commit 8441e577 authored by Christos's avatar Christos

Merge branch 'recreate-last-selection' into 'master'

recreate last selection

See merge request wax/wax!237
parents 0064d4d2 543f7da3
......@@ -219,17 +219,18 @@ class Wax extends React.Component {
e.clientY > bottom
) {
const { editorSession } = this.editor
const selection = editorSession.getSelection()
const surface = editorSession.surfaceManager.getSurface(containerId)
// If there is no selection, simply put the focus at the beginning of the doc
if (selection.isNull()) {
if (editorSession.getSelection().isNull()) {
surface.setFocusOnStartOfText()
return
}
// If there is a selection, recreate its last position
editorSession.setSelection(selection)
setTimeout(() => {
editorSession.setSelection(editorSession.getSelection())
})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment