Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(behavior): add select event #644

Merged
merged 2 commits into from
Jan 2, 2025
Merged

Conversation

christianhg
Copy link
Member

No description provided.

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
portable-text-editor-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 0:17am
portable-text-example-basic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 0:17am
portable-text-example-legacy ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 0:17am
portable-text-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 0:17am

The `select` event is the first behavior event added that risks being triggered
during behavior actions. For example, `decorator.toggle` triggers a bunch of
internal Slate APIs under the hood, including `Transforms.select` which in turn
calls `editor.select`. This recursive behavior, however, does not play well.
Therefore, we now set a new `IS_APPLYING_BEHAVIOR_ACTIONS` flag that we check
before sending a `select` behehavior event. If we are in the middle of applying
behavior actions, we just call the default `select` method.
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