Skip to content

Commit 6fdb1b0

Browse files
author
Zaydek Michels-Gualtieri
committed
Added a 200ms buffer for state.lastActionTimestamp
1 parent 740b736 commit 6fdb1b0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/RichTextEditor/methods/RichTextEditor.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ const actionEnum = newEnum(
2222

2323
// Registers an action.
2424
export const registerAction = e => action => {
25-
e.lastActionTimestamp = Date.now()
25+
const now = Date.now()
26+
if (now - e.lastActionTimestamp < 200) {
27+
// No-op
28+
return
29+
}
30+
e.lastActionTimestamp = now
2631
e.lastAction = action
2732
}
2833

0 commit comments

Comments
 (0)