1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 15:32:59 +02:00

Ensure cursor is shown after delete hanging selection (#1779)

This commit is contained in:
Jinxuan Zhu
2018-04-27 17:08:36 -04:00
committed by Ian Storm Taylor
parent bbbf73fc12
commit 7e663eea12
2 changed files with 6 additions and 2 deletions

View File

@@ -40,6 +40,11 @@ PROXY_TRANSFORMS.forEach(method => {
const { selection } = value const { selection } = value
const methodAtRange = `${method}AtRange` const methodAtRange = `${method}AtRange`
change[methodAtRange](selection, ...args) change[methodAtRange](selection, ...args)
if (method.match(/Backward$/)) {
change.collapseToStart()
} else if (method.match(/Forward$/)) {
change.collapseToEnd()
}
} }
}) })

View File

@@ -23,9 +23,8 @@ export const output = (
<value> <value>
<document> <document>
<paragraph> <paragraph>
<anchor />
<link> <link>
<focus />wo <cursor />wo
</link> </link>
</paragraph> </paragraph>
</document> </document>