mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-02 11:42:53 +02:00
Normalize selection after all transforms
This commit is contained in:
@@ -47,16 +47,15 @@ class Transform {
|
|||||||
* @property {Boolean} isNative
|
* @property {Boolean} isNative
|
||||||
* @property {Boolean} merge
|
* @property {Boolean} merge
|
||||||
* @property {Boolean} save
|
* @property {Boolean} save
|
||||||
* @property {Boolean} normalize
|
|
||||||
* @return {State} state
|
* @return {State} state
|
||||||
*/
|
*/
|
||||||
|
|
||||||
apply(options = {}) {
|
apply(options = {}) {
|
||||||
let transform = this
|
let transform = this
|
||||||
let { merge, save, isNative = false, normalize = true } = options
|
let { merge, save, isNative = false } = options
|
||||||
|
|
||||||
// Ensure that the state is normalized.
|
// Ensure that the selection is normalized.
|
||||||
// if (normalize) transform = transform.normalize()
|
transform = transform.normalizeSelection()
|
||||||
|
|
||||||
let { state, operations } = transform
|
let { state, operations } = transform
|
||||||
let { history } = state
|
let { history } = state
|
||||||
|
Reference in New Issue
Block a user