Skip to content

fix: resolve list item selection against current doc#2412

Open
highestop wants to merge 1 commit into
Milkdown:mainfrom
highestop:highestop-fix-list-item-stale-positions
Open

fix: resolve list item selection against current doc#2412
highestop wants to merge 1 commit into
Milkdown:mainfrom
highestop:highestop-fix-list-item-stale-positions

Conversation

@highestop

Copy link
Copy Markdown
Contributor
  • I read the contributing guide
  • I agree to follow the code of conduct

Summary

Fixes highestop#2.

  • Resolve the saved selection offsets against the current document inside the RAF callback.
  • Replace the content-equality guard with a bounds check before resolving positions.
  • Dispatch a transaction from the same current editor state used to build the selection.
  • Add a patch changeset for @milkdown/components.

How did you test this change?

  • pnpm install --frozen-lockfile
  • pnpm --filter @milkdown/components test
  • pnpm build:tsc
  • pnpm test:lint
  • pnpm test
  • pnpm build

Resolve deferred list item block cursor positions during the animation frame.

Keep the generated selection tied to the same current document as the transaction.

Co-Authored-By: Zero <zero@vm0.ai>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

@highestop is attempting to deploy a commit to the Milkdown Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1638498

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
@milkdown/components Patch
@milkdown/kit Patch
@milkdown/crepe Patch
@milkdown/react Patch
@milkdown/vue Patch
@milkdown/core Patch
@milkdown/ctx Patch
@milkdown/exception Patch
@milkdown/prose Patch
@milkdown/transformer Patch
@milkdown/utils Patch
@milkdown/plugin-automd Patch
@milkdown/plugin-block Patch
@milkdown/plugin-clipboard Patch
@milkdown/plugin-collab Patch
@milkdown/plugin-cursor Patch
@milkdown/plugin-diff Patch
@milkdown/plugin-emoji Patch
@milkdown/plugin-highlight Patch
@milkdown/plugin-history Patch
@milkdown/plugin-indent Patch
@milkdown/plugin-listener Patch
@milkdown/plugin-prism Patch
@milkdown/plugin-slash Patch
@milkdown/plugin-streaming Patch
@milkdown/plugin-tooltip Patch
@milkdown/plugin-trailing Patch
@milkdown/plugin-upload Patch
@milkdown/preset-commonmark Patch
@milkdown/preset-gfm Patch
@milkdown/theme-nord Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@milkdown/components

npm i https://pkg.pr.new/@milkdown/components@2412

@milkdown/core

npm i https://pkg.pr.new/@milkdown/core@2412

@milkdown/crepe

npm i https://pkg.pr.new/@milkdown/crepe@2412

@milkdown/ctx

npm i https://pkg.pr.new/@milkdown/ctx@2412

@milkdown/exception

npm i https://pkg.pr.new/@milkdown/exception@2412

@milkdown/kit

npm i https://pkg.pr.new/@milkdown/kit@2412

@milkdown/prose

npm i https://pkg.pr.new/@milkdown/prose@2412

@milkdown/transformer

npm i https://pkg.pr.new/@milkdown/transformer@2412

@milkdown/utils

npm i https://pkg.pr.new/@milkdown/utils@2412

@milkdown/react

npm i https://pkg.pr.new/@milkdown/react@2412

@milkdown/vue

npm i https://pkg.pr.new/@milkdown/vue@2412

@milkdown/plugin-automd

npm i https://pkg.pr.new/@milkdown/plugin-automd@2412

@milkdown/plugin-block

npm i https://pkg.pr.new/@milkdown/plugin-block@2412

@milkdown/plugin-clipboard

npm i https://pkg.pr.new/@milkdown/plugin-clipboard@2412

@milkdown/plugin-collab

npm i https://pkg.pr.new/@milkdown/plugin-collab@2412

@milkdown/plugin-cursor

npm i https://pkg.pr.new/@milkdown/plugin-cursor@2412

@milkdown/plugin-diff

npm i https://pkg.pr.new/@milkdown/plugin-diff@2412

@milkdown/plugin-emoji

npm i https://pkg.pr.new/@milkdown/plugin-emoji@2412

@milkdown/plugin-highlight

npm i https://pkg.pr.new/@milkdown/plugin-highlight@2412

@milkdown/plugin-history

npm i https://pkg.pr.new/@milkdown/plugin-history@2412

@milkdown/plugin-indent

npm i https://pkg.pr.new/@milkdown/plugin-indent@2412

@milkdown/plugin-listener

npm i https://pkg.pr.new/@milkdown/plugin-listener@2412

@milkdown/plugin-prism

npm i https://pkg.pr.new/@milkdown/plugin-prism@2412

@milkdown/plugin-slash

npm i https://pkg.pr.new/@milkdown/plugin-slash@2412

@milkdown/plugin-streaming

npm i https://pkg.pr.new/@milkdown/plugin-streaming@2412

@milkdown/plugin-tooltip

npm i https://pkg.pr.new/@milkdown/plugin-tooltip@2412

@milkdown/plugin-trailing

npm i https://pkg.pr.new/@milkdown/plugin-trailing@2412

@milkdown/plugin-upload

npm i https://pkg.pr.new/@milkdown/plugin-upload@2412

@milkdown/preset-commonmark

npm i https://pkg.pr.new/@milkdown/preset-commonmark@2412

@milkdown/preset-gfm

npm i https://pkg.pr.new/@milkdown/preset-gfm@2412

@milkdown/theme-nord

npm i https://pkg.pr.new/@milkdown/theme-nord@2412

commit: 1638498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list-item-block NodeView: stale resolved positions cause RangeError in deferred selection

1 participant