fix active check for ordered list, fix #78

This commit is contained in:
Philipp Kühn 2018-11-05 23:50:28 +01:00
parent e7e1a9f76e
commit f01d641e4b

View File

@ -1,10 +1,10 @@
import { findParentNode } from 'prosemirror-utils'
export default function (state, type, attrs) {
export default function (state, type, attrs = {}) {
const predicate = node => node.type === type
const parent = findParentNode(predicate)(state.selection)
if (attrs === {} || !parent) {
if (!Object.keys(attrs).length || !parent) {
return !!parent
}