1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

Fix marks being cleared on selection events (#2158)

This commit is contained in:
Nicolas Gaborit 2018-09-18 03:33:01 +02:00 committed by Ian Storm Taylor
parent f75a274c0e
commit ea950ac1af

View File

@ -677,6 +677,10 @@ function AfterPlugin() {
if (next) range = range.moveFocusTo(next.key, 0)
}
// Preserve active marks from the current selection.
// They will be cleared by `change.select` if the selection actually moved.
range = range.set('marks', value.selection.marks)
let selection = document.createSelection(range)
selection = selection.setIsFocused(true)
change.select(selection)