Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Confused with Tiptap editor behaviour?

I'm trying Tiptap editor and playing with some dummy code. But I'm confused with the behaviour. Could somebody please help me understand the behaviour ?

Below is the dummy code I'm trying (Below 4 cases were tried individually, just here for mentioning I'm placing them in one code block under same braces) :

const customCommand = () => ({commands, state, editor}) => {

// Doesn't work. Parent node doesn't change
console.log('current node ', state.selection.from)
commands.selectParentNode()
console.log('parent node ', state.selection.from)

// Doesn't work. Parent node doesn't change
console.log('current node ', state.selection.from)
this.editor.commands.selectParentNode()
console.log('parent node ', state.selection.from)

// Doesn't work. Parent node doesn't change
console.log('current node ', this.editor.view.state.selection.from)
commands.selectParentNode()
console.log('parent node ', this.editor.view.state.selection.from)

// Works. Parent Node changes.
console.log('current node ', this.editor.view.state.selection.from)
editor.commands.selectParentNode()
console.log('parent node ', this.editor.view.state.selection.from)

}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!