Skip to content

fix: remove internal select and setSelection editor methods#2369

Closed
christianhg wants to merge 2 commits intomainfrom
fix/remove-select-setSelection
Closed

fix: remove internal select and setSelection editor methods#2369
christianhg wants to merge 2 commits intomainfrom
fix/remove-select-setSelection

Conversation

@christianhg
Copy link
Member

Removes editor.select and editor.setSelection from the editor interface. All callers now import the core functions directly from core/select and core/set-selection.

The behavior-api plugin that intercepted these calls is deleted. It sent behavior events for every selection change, but no behavior actually intercepts the raw select event — the round-trip through the behavior system was a no-op. Selection updates to the editor machine still work because updateSelectionPlugin fires on every onChange independently of the behavior-api plugin.

Callers that previously went through editor.select() or editor.setSelection() (Slate core internals like collapse, move, delete-text, insert-nodes, insert-text; DOM layer code in dom-editor, editable.tsx, android-input-manager; and PTE layer code in Editable.tsx and editor-machine) now call the core functions directly.

Remove editor.select and editor.setSelection from the editor interface.
All callers now import the core functions directly. The behavior-api
plugin that intercepted these calls to send behavior events is deleted
since no behavior intercepts the raw select event — the round-trip
through the behavior system was a no-op.
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portable-text-example-basic Error Error Mar 13, 2026 0:50am
portable-text-playground Error Error Mar 13, 2026 0:50am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

⚠️ No Changeset found

Latest commit: 8e56adc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Contributor

Bundle Stats — Calculating bundle sizes for @portabletext/editor...

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.

1 participant