Making a RichEditor field required

How do you guys do this? If I add required() it doesn’t work, I guess because it always has a “<p></p>” value? Is this is a TipTap problem or was this already the case in v3? Weird no else seems to have this issue.
Solution:
It’s a Tiptap thing. It always has to have at least one element which is the default empty p tag. Might be a good pr for a custom required validation or check in the dehydrate state to see if it is empty. For now though you could do a custom required rule. V3 didn’t use tiptap so wasn’t an issue there....
Jump to solution
6 Replies
Tim van Heugten
Tim van HeugtenOP3mo ago
I could very well be doing some stupid, but I think I’ve tried several things now.
Solution
awcodes
awcodes3mo ago
It’s a Tiptap thing. It always has to have at least one element which is the default empty p tag. Might be a good pr for a custom required validation or check in the dehydrate state to see if it is empty. For now though you could do a custom required rule. V3 didn’t use tiptap so wasn’t an issue there.
Tim van Heugten
Tim van HeugtenOP3mo ago
Swear I tried to search, but thanks! I’ll try to do a pr or at least raise an issue for it. Should be fixed or else mentioned in docs.
awcodes
awcodes3mo ago
I think that’s reasonable.
awcodes
awcodes3mo ago
At least do an issue for it. A pr/fix would be better but an issue at least gets it on the radar for the team investigate and act on.

Did you find this page helpful?