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

Move hasRange to core #4191

Conversation

juliankrispel
Copy link
Collaborator

@juliankrispel juliankrispel commented Apr 11, 2021

Description
Moves hasRange to core Editor, as described in #4160 (comment)

Issue
Fixes #4160

Example
n/a

Context
Moves hasRange from ReactEditor to Editor.
Non-breaking since ReactEditor inherits from Editor,

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.)

@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2021

🦋 Changeset detected

Latest commit: 882fd5e

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

This PR includes changesets to release 4 packages
Name Type
slate Minor
slate-react Minor

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

@ianstormtaylor
Copy link
Owner

Thanks for this @juliankrispel! I think this is actually breaking unfortunately because the ReactEditor namespace doesn't inherit all of the helper utilities from the Editor namespace.

I've got a related fix in #4177 that re-implements hasRange as Range.exists since I realized while moving it that there's nothing editor-specific about how it was written. I'm going to close in favor of that one, hope that makes sense. (Sorry for not properly linking that issue to give you a heads up that it would be solved!)

@juliankrispel
Copy link
Collaborator Author

Thanks for this @juliankrispel! I think this is actually breaking unfortunately because the ReactEditor namespace doesn't inherit all of the helper utilities from the Editor namespace.

I've got a related fix in #4177 that re-implements hasRange as Range.exists since I realized while moving it that there's nothing editor-specific about how it was written. I'm going to close in favor of that one, hope that makes sense. (Sorry for not properly linking that issue to give you a heads up that it would be solved!)

no worries thanks for clearing that up

@juliankrispel juliankrispel deleted the 4160-move-hasRange-to-core branch April 13, 2021 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move hasRange method to core Editor
2 participants