[v4] RichEditor (tiptap) always leave a `<p></p>` behind!

not sure dose this consider a bug? since I dont remember the same behavior on adams tiptap plugin. test code:
RichEditor::make('details')
->live()
->belowContent(fn(Get $get)=>$get('details')),
RichEditor::make('details')
->live()
->belowContent(fn(Get $get)=>$get('details')),
and storing it as html.. when remove all content from the editor still there a P tag. if this normal, how we should check if the field has actual content or not. previously we do: if(filled($zeusForm->details)) but its always filled even if the user didnt write anything!
Solution:
I swear I’m handling this some where in my plugin to convert between null and the tag, but can’t find it. 😂 But, yes, it’s expected behavior with Tiptap since it has to have p tag at minimum with prosemirror, otherwise you wouldn’t be able to insert a cursor to start typing....
Jump to solution
3 Replies
Lara Zeus
Lara ZeusOP4mo ago
for now: filled(strip_tags($zeusForm->details))
Solution
awcodes
awcodes4mo ago
I swear I’m handling this some where in my plugin to convert between null and the tag, but can’t find it. 😂 But, yes, it’s expected behavior with Tiptap since it has to have p tag at minimum with prosemirror, otherwise you wouldn’t be able to insert a cursor to start typing.
Lara Zeus
Lara ZeusOP4mo ago
got it now, make sense 👍
i think filled(strip_tags($zeusForm->details)) is good enough

Did you find this page helpful?