Repository navigation
feat(paste): return a Promise from onPaste - #98
Merged
neSpecc merged 1 commit intoNov 27, 2026
Merged
Conversation
neSpecc
reviewed
Nov 27, 2026
neSpecc
left a comment
Contributor
There was a problem hiding this comment.
Thanks! The change looks good. This repo has no automatic version bump. Please bump it to 2.11.8 in this PR.
Then, update @editor.js/paragraph version in Editor Core package.json to 2.11.8 in codex-team/editor.js#3035
Resolve it after the pasted content is set in the animation frame, so Editor.js can place the caret once the text is in the block. Signed-off-by: anshurajbisoyi98-ctrl <anshurajbisoyi98@gmail.com>
anshurajbisoyi98-ctrl
force-pushed
the
fix-onpaste-promise
branch
from
November 27, 2026 09:22
35eb362 to
f89dc38
Compare
Contributor
Author
|
Bumped to 2.11.8 here and updated |
neSpecc
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to codex-team/editor.js#3035.
Editor.js will wait for a Promise returned from
onPastebefore placing the caret after paste. Paragraph sets the pasted HTML in arequestAnimationFrame, soonPastenow returns a Promise that resolves right afterinnerHTMLis set. Older Editor.js versions ignore the return value, so nothing changes for them.I checked it by linking this build into editor.js on the branch of that PR: pasting
First block\n\nSecond blockand typing now givesSecond blockXinstead ofXSecond block.I left
distalone, assuming it gets rebuilt on release.