NiclasDev63 / tiptap-extension-global-drag-handle

MIT License
73 stars 13 forks source link

Option to hide drag handle based on a condition #19

Open cchandurkar opened 2 months ago

cchandurkar commented 2 months ago

I want to hide the drag handle based on conditions like empty paragraphs, a special checklist, etc.

Screenshot 2024-09-24 002258

Two potential ways of doing it could be:

  1. Add shouldShow: (node: Node) => boolean config method that checks if the handle should be shown.
  2. Replace excludedTags[] with excludedSelectors[] that can take a qualifying DOM selector such as p.is-empty or ul.special-checklist etc.
cchandurkar commented 2 months ago

Edit: I think the p.is-empty already works in excludeTags[].