mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-13 17:59:01 +08:00
fix active check for ordered list, fix #78
This commit is contained in:
parent
e7e1a9f76e
commit
f01d641e4b
@ -1,10 +1,10 @@
|
|||||||
import { findParentNode } from 'prosemirror-utils'
|
import { findParentNode } from 'prosemirror-utils'
|
||||||
|
|
||||||
export default function (state, type, attrs) {
|
export default function (state, type, attrs = {}) {
|
||||||
const predicate = node => node.type === type
|
const predicate = node => node.type === type
|
||||||
const parent = findParentNode(predicate)(state.selection)
|
const parent = findParentNode(predicate)(state.selection)
|
||||||
|
|
||||||
if (attrs === {} || !parent) {
|
if (!Object.keys(attrs).length || !parent) {
|
||||||
return !!parent
|
return !!parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user