You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.
In the sample code, we can disabled the button by checking inList. If we are at the first "li", we should also disable the button because it will do nothing to increaseItemDepth, how can we know whether we are at the first "li"?
Thanks lot
Gary
The text was updated successfully, but these errors were encountered:
Here is a dumb solution: check for value.document === value.change.call(increaseItemDepth ...).document.
Or maybe the plugin could expose a function:
// If the given node is inside a list, returns all the ancestor lists as well as the // item index sequence in each of these list that leads to the given node.functiongetPositionInList(document: Slate.Document,key: string): ?ListPositiontypeListPosition={// The conceptual sequence of item index that leads to the current nodepath: List<number>ancestors: List<Slate.Block>}
<button className={inList ? '' : 'disabled'} onClick={() => {this.call(increaseItemDepth)}}>
In the sample code, we can disabled the button by checking inList. If we are at the first "li", we should also disable the button because it will do nothing to increaseItemDepth, how can we know whether we are at the first "li"?
Thanks lot
Gary
The text was updated successfully, but these errors were encountered: