NiclasDev63 / tiptap-extension-global-drag-handle

MIT License
68 stars 12 forks source link

Option to hide drag handle based on a condition #19

Open cchandurkar opened 1 month ago

cchandurkar commented 1 month 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 1 month ago

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