1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 17:39:57 +02:00

add ability to click multiple emojis in example (#1619)

* add ability to click multiple emojis

currently, after clicking one emoji, user needs to click in the editor before being able to add another emoji
this fixes that by jumping to next text block and focusing selection to make it obvious where next insertion will take place.

* lint code
This commit is contained in:
Andrei Railean
2018-02-09 12:09:06 +11:00
committed by Ian Storm Taylor
parent 0df151ee52
commit 0c7703e206

View File

@@ -77,11 +77,14 @@ class Emojis extends React.Component {
const { value } = this.state const { value } = this.state
const change = value.change() const change = value.change()
change.insertInline({ change
type: 'emoji', .insertInline({
isVoid: true, type: 'emoji',
data: { code }, isVoid: true,
}) data: { code },
})
.collapseToStartOfNextText()
.focus()
this.onChange(change) this.onChange(change)
} }