kommitters / editorjs-undo

Undo/Redo feature for Editor.js
https://www.npmjs.com/package/editorjs-undo
MIT License
169 stars 51 forks source link

Fix caret in new editorJS versions #235

Closed MarioRodriguezS closed 11 months ago

MarioRodriguezS commented 11 months ago

Description

This pull request solves the caret bug, it was lost when trying to undo and redo actions in some editorJS versions and projects built with development-built tools such as vite. It implements awaits and timers in the caret and blocks operations as suggested here.

Evidence

Before:

https://github.com/kommitters/editorjs-undo/assets/64106728/1b5a8358-50ac-4b4e-b631-7bc3e3c68c5f

After:

https://github.com/kommitters/editorjs-undo/assets/64106728/bca849ea-284a-410e-88c5-184419e0f731