Repository navigation
Conversation
|
@milkdown/components
@milkdown/core
@milkdown/crepe
@milkdown/ctx
@milkdown/exception
@milkdown/kit
@milkdown/prose
@milkdown/transformer
@milkdown/utils
@milkdown/react
@milkdown/vue
@milkdown/plugin-automd
@milkdown/plugin-block
@milkdown/plugin-clipboard
@milkdown/plugin-collab
@milkdown/plugin-cursor
@milkdown/plugin-diff
@milkdown/plugin-emoji
@milkdown/plugin-highlight
@milkdown/plugin-history
@milkdown/plugin-indent
@milkdown/plugin-listener
@milkdown/plugin-prism
@milkdown/plugin-slash
@milkdown/plugin-streaming
@milkdown/plugin-tooltip
@milkdown/plugin-trailing
@milkdown/plugin-upload
@milkdown/preset-commonmark
@milkdown/preset-gfm
@milkdown/theme-nord
commit: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2495. Thanks to @9BwgeBTPG-QH for the report.
TableNodeView#handleClickcapturedstateanddispatchat click time, then dispatchedstate.tr.setSelection(...)later fromrequestAnimationFrame(orsetTimeout(20)when the old selection is aCellSelection). The transaction was built from that stale state, so a selection set between the click and the callback was replaced by the click'sNodeSelection.The deferred callback now builds the transaction from
view.state, and does nothing if the selection is no longer the one seen at click time. The early returns and theCellSelectionbranch are unchanged.How did you test this change?
Added
packages/components/src/table-block/__tests__/view.spec.ts. It stubsrequestAnimationFrame, triggers the cell pointerdown, dispatches a different selection, then flushes the frame and checks the newer selection is kept. A second test checks the click still selects the cell when nothing changed in between.vitest run src/table-blockin packages/components: 2 passed.view.tsreverted: the first test fails (the newer selection is overwritten), the second passes.vitest runin packages/components: 6 files, 32 tests passed.oxlint -c .oxlintrc.json --deny-warningsandoxfmt --checkon table-block: clean.Replaces #2508, which got closed when my fork was accidentally detached.