New Feb 12, 2026

How to fix indent not working in TipTap taskItem nodes?

Libraries, Frameworks, etc. All from Newest questions tagged vue.js - Stack Overflow View How to fix indent not working in TipTap taskItem nodes? on stackoverflow.com

Why doesn't indent work in the taskitem, but after refreshing it works? When I click on the browser's inspect tool and try to set margin-left, the previously set indent takes effect immediately. Why does this happen?

let docChanged = false
    doc.nodesBetween(from, to, (node, pos) => {
        if (!options.types.includes(node.type.name)) return true

const currentIndent = node.attrs.indent || 0 const change = options.indentUnit * direction const newIndent = Math.max(0, currentIndent + change)

if (currentIndent !== newIndent) { tr = tr.setNodeMarkup(pos, undefined, { ...node.attrs, indent: newIndent }) docChanged = true } return false // 不深入子节点 })

if (docChanged) { if (dispatch) dispatch(tr) return true }

indent: {
                        default: 0,
                        parseHTML: element => {
                            const level = element.style.marginLeft
                            return level ? parseInt(level, 10) : 0
                        },
                        renderHTML: attributes => {
                            if (!attributes.indent) return {}
                            return { style: `margin-left: ${attributes.indent}px !important` }
                        }
                    },
Scroll to top