Closed kalley closed 6 years ago
Try https://deploy-preview-1985--slatejs.netlify.com/#/hovering-menu Seems to be fixed in https://github.com/ianstormtaylor/slate/pull/1985 by @zhujinxuan
@linonetwo For some reason, that fix does not work for me.
It looks like number passed where a string is expected. Btw, what is the difference between isCollapsed (which works) and isEmpty (which fails for now)?
I think it is perhaps related to https://github.com/ianstormtaylor/slate/pull/1997.
I think I've narrowed it down to getFragmentAtRange
not passing a path
to splitNode
. I'm still getting up to speed with path
s, so wanted to put this here in case someone sees a quick fix.
@kalley splitNode is not a change method. (It is a method under the same model/node.js....) . I think the error is perhaps from somewhere else.
I think some proxy method in https://github.com/ianstormtaylor/slate/blob/master/packages/slate/src/changes/on-selection.js
is not right.
This is not about a change method. This is about value.isEmpty
being called after a change action in an component update call. So you have to follow the call stack from value.isEmpty
, which is how I figured that the while loop is passing a number to splitNode
. I just don't know enough about path
s yet to figure out what should be happening.
isCollapsed is quick workaround, working isEmpty would be better ofc.
Fixed by #2012, thanks for reporting @kalley.
Do you want to request a feature or report a bug?
bug
What's the current behavior?
Go to: https://www.slatejs.org/#/hovering-menu
Click inside and command+a (or ctrl+a) to select all. You'll see an error.
This is coming from
value.isEmpty
being called in the check. I'm not sure what should change though.What's the expected behavior?
Expected behavior would be that it selects all and does not error out.