Enhance embeddable campaign editor with assets and richer templates#14
Enhance embeddable campaign editor with assets and richer templates#14112-stack wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| el.addEventListener('dragover', (e) => e.preventDefault()); | ||
| el.addEventListener('drop', (e) => { | ||
| e.preventDefault(); | ||
| const type = e.dataTransfer.getData('text/plain'); | ||
| if (type) onDrop(type); |
There was a problem hiding this comment.
Drop handler bound repeatedly on canvas re-render
Each call to renderCanvas adds new dragover/drop listeners directly to the persistent canvas element without removing prior ones. Because render() calls renderCanvas after every change, those listeners accumulate; after the first drop renders a new state, the next drop from the palette will invoke onDrop multiple times and insert duplicate blocks (one per previous render). Bind the handler once or clear existing listeners before re-rendering to avoid duplicated block creation.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task