Manoj Mondal

Writing

Notes on canvas tools, PDFs and editors from Manoj Mondal, frontend engineer.

  1. · 4 min read

    Why contenteditable fights you: syncing the DOM with state

    With contenteditable, the browser changes the DOM before your code hears about it, so your state and the page drift apart. Here is how to read from the DOM, keep undo and the cursor in step, clean up legacy HTML, and handle selection across header, body and footer.

    • #frontend
    • #rich-text
    • #contenteditable
  2. · 3 min read

    TanStack Redact: swapping React's browser runtime for a smaller one

    TanStack's Redact replaces React and React DOM in the browser at build time. The bundle savings are real but depend on your framework, and the catch is synchronous rendering. Here is what I would check before trying it.

    • #react
    • #performance
    • #tanstack
  3. · 3 min read

    Why PDF coordinates flip on the Y axis

    A PDF measures from the bottom-left corner in points, a screen measures from the top-left in pixels. Here is the one-line conversion, and the edge cases that break it.

    • #canvas
    • #pdf