1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 05:31:56 +02:00

replace setTimeout (#1371)

This commit is contained in:
Yifeng Wang
2017-11-12 07:28:55 +08:00
committed by Ian Storm Taylor
parent 0afe15fa76
commit 816c981436

View File

@@ -139,7 +139,7 @@ function BeforePlugin() {
// The `count` check here ensures that if another composition starts
// before the timeout has closed out this one, we will abort unsetting the
// `isComposing` flag, since a composition is still in affect.
setTimeout(() => {
window.requestAnimationFrame(() => {
if (compositionCount > n) return
isComposing = false