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

this.document.getPreviousInline is not a function #1794

Closed
kalley opened this issue Apr 24, 2018 · 3 comments
Closed

this.document.getPreviousInline is not a function #1794

kalley opened this issue Apr 24, 2018 · 3 comments

Comments

@kalley
Copy link
Contributor

kalley commented Apr 24, 2018

Do you want to request a feature or report a bug?

bug

What's the current behavior?

When calling value.previousInline, and error gets thrown because this.document.getPreviousInline is not a function

fiddle: https://jsfiddle.net/qmxu8ocy/ (type anything)

OS: mac
browser: Chrome
slate version: 0.33.4

What's the expected behavior?

It would return the previous inline if it existed.

I'm getting around it right now by using value.document.getPreviousSibling and checking if it's inline or not. I looked through history and I'm not sure that getPreviousInline ever existed 🤷‍♂️

@davidchang
Copy link
Contributor

seems like

/**
* Get the next inline node.
*
* @return {Inline}
*/
get nextInline() {
return this.endKey && this.document.getNextInline(this.endKey)
}
/**
* Get the previous inline node.
*
* @return {Inline}
*/
get previousInline() {
return this.startKey && this.document.getPreviousInline(this.startKey)
}
should be removed from the value API, though that might warrant a minor version bump? looks like neither previousInline nor nextInline in the Slate codebase itself. unless we want to implement getPreviousInline and getNextInline on document

@ianstormtaylor
Copy link
Owner

Open to a PR that adds those two.

@ianstormtaylor
Copy link
Owner

As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants