Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8257d56fcc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| onReady: () => { | ||
| setTimeout(setupClickToToggle, 500); | ||
| }, |
There was a problem hiding this comment.
Clear delayed toggle hook before replacing editor instance
The onReady callback defers setupClickToToggle with setTimeout, but the watch(file, ...) path destroys/recreates superdoc without cancelling any previously scheduled timeout. If a user changes documents quickly, the old timeout can run after superdoc points to the new instance and attach a duplicate selectionUpdate listener there, causing a single click/selection entry to toggle a checkbox twice (effectively no-op). Store the timeout id and clear it during teardown (or bind setup to a captured editor instance) to avoid duplicate handlers.
Useful? React with 👍 / 👎.
No description provided.