Pasting markdown/code inserts React NodeViews that mount asynchronously; until the next reflow the browser's hit-test geometry is stale, so ProseMirror's posAtCoords/caretRangeFromPoint maps a click to the wrong (offset) line — which users reported clears itself on any scroll. Reproduce that scroll's side effect with a ZERO-delta nudge (re-assign scrollTop/scrollLeft to their current value) on every scrollable ancestor + the document scrolling element, run across two animation frames so it lands after the pasted content + NodeViews commit. The nudge does not move the viewport. Wired into editor-paste-handler's handlePaste, which ProseMirror's someProp runs (as an editorProps handler) before the MarkdownClipboard plugin that performs the markdown/code insert — so the nudge is scheduled on exactly the paste path that triggers the bug. Complements the structural NodeViewContent-order fix in this branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist