Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My tiptap bubble_menu works, but it also does a form submission when the menu item is clicked

Tags:

tiptap

For example, I was using this:

<button  onclick="editor.chain().focus().toggleBold().run()">

But I got the solution from the kind folks on the discord server.

like image 222
TaiwanGrapefruitTea Avatar asked Oct 20 '25 08:10

TaiwanGrapefruitTea


1 Answers

For the menu item, specify type=button (otherwise browser might think it's a submit button type)

<button type=button  onclick="editor.chain().focus().toggleBold().run()">
like image 137
TaiwanGrapefruitTea Avatar answered Oct 22 '25 23:10

TaiwanGrapefruitTea