Optional DraggableBlockPlugin & AddBlockHandlePlugin #13636
Replies: 2 comments 2 replies
-
I agree! Would accept a PR if someone wants to make one, or I'll get to it myself once I find some time. In 4.0, we could make those standalone features instead of flags (similar to the fixed toolbar). I'm a fan of extracting this kind of functionality into features and keeping the core editor code clean and unopinionated. |
Beta Was this translation helpful? Give feedback.
-
I'd be more than happy to create a PR for this over this weekend if you don't already want to @jcgsville. We have the same use case in one of our projects and currently do the same css workaround so it'll be nice to have a proper way to handle this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems like, from this code, payload always adds the DraggableBlockPlugin and AddBlockHandlePlugin to all payload
LexicalEditor
s.I'm trying to create a single-line LexicalEditor for Payload. There are customizable content slots in my app that I want to enforce are a single line.
I could just validate the json content of the editor using a payload hook, but I'd like to make a better editing experience for my users. I've hooked into payload to make the KEY_ENTER_COMMAND do nothing, but there is not a great way to remove the "+" button and the drag handles left of the block in the editor.
I've gotten around this by using custom css to make the elements hidden.
However, it seems like we could build on the pattern established by
admin.hideInsertParagraphAtEnd
and add some new options:hideAddBlockButton
andhideDraggableBlockButton
that make it easier to omit these from the editor.Thanks for your great work on Payload
Beta Was this translation helpful? Give feedback.
All reactions