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

Fix reporting of marks on a markableVoid #5186

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

SmilinBrian
Copy link
Contributor

Description
Now that markableVoid() allows marks to be applied to inline voids, our users discovered a problem where the marks applied to a currently-selected markable void are not reported properly by Editor.marks()

I have added a few unit tests for the previously un-tested Editor.marks(), including one for markable void that failed before the fix (markable-void-collapsed).

The if (anchor.offset === 0) test in Editor.marks() that checks if the prevPath is in the same block was effectively returning the marks of any Text that preceded the selected markable void.

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

Add a few unit tests for Editor.marks(), including one for markable void
that fails
@dylans dylans merged commit e416d00 into ianstormtaylor:main Nov 17, 2022
@github-actions github-actions bot mentioned this pull request Nov 17, 2022
z2devil pushed a commit to z2devil/slate that referenced this pull request Dec 6, 2024
Add a few unit tests for Editor.marks(), including one for markable void
that fails
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.

2 participants