roosterjs-content-model-core
Advanced tools
Comparing version 0.21.2 to 0.21.3
@@ -24,2 +24,3 @@ define(["require", "exports", "tslib", "../constants/ChangeSource"], function (require, exports, tslib_1, ChangeSource_1) { | ||
}; | ||
var hasFocus = core.api.hasFocus(core); | ||
var selection; | ||
@@ -30,4 +31,4 @@ if (formatter(model, context)) { | ||
selection = | ||
core.api.setContentModel(core, model, undefined /*options*/, onNodeCreated) || | ||
undefined; | ||
core.api.setContentModel(core, model, hasFocus ? undefined : { ignoreSelection: true }, // If editor did not have focus before format, do not set focus after format | ||
onNodeCreated) || undefined; | ||
handlePendingFormat(core, context, selection); | ||
@@ -34,0 +35,0 @@ }; |
@@ -22,2 +22,3 @@ import { __assign } from "tslib"; | ||
}; | ||
var hasFocus = core.api.hasFocus(core); | ||
var selection; | ||
@@ -28,4 +29,4 @@ if (formatter(model, context)) { | ||
selection = | ||
core.api.setContentModel(core, model, undefined /*options*/, onNodeCreated) || | ||
undefined; | ||
core.api.setContentModel(core, model, hasFocus ? undefined : { ignoreSelection: true }, // If editor did not have focus before format, do not set focus after format | ||
onNodeCreated) || undefined; | ||
handlePendingFormat(core, context, selection); | ||
@@ -32,0 +33,0 @@ }; |
@@ -25,2 +25,3 @@ "use strict"; | ||
}; | ||
var hasFocus = core.api.hasFocus(core); | ||
var selection; | ||
@@ -31,4 +32,4 @@ if (formatter(model, context)) { | ||
selection = | ||
core.api.setContentModel(core, model, undefined /*options*/, onNodeCreated) || | ||
undefined; | ||
core.api.setContentModel(core, model, hasFocus ? undefined : { ignoreSelection: true }, // If editor did not have focus before format, do not set focus after format | ||
onNodeCreated) || undefined; | ||
handlePendingFormat(core, context, selection); | ||
@@ -35,0 +36,0 @@ }; |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "0.21.2", | ||
"version": "0.21.3", | ||
"main": "./lib/index.js", | ||
@@ -14,0 +14,0 @@ "typings": "./lib/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1999233
18244