mdx-editor / mdx-editor/editor

Removing directive node is hard

Open
#226 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.7k
Forks
307
Avg merge
14h 22m
Merged PRs (30d)
5

Description

If you create a custom directive, ie. like YouTube directive in examples and insert it into the editor, the node is really hard to remove from the editor content.

If using generic editor with children option, node can be removed by settings the cursor in the nested editor and pressing backspace. But if using generic directive without children option, it's almost impossible to remove added node from the editor. Sometimes I managed to remove it by selecting whole area and then pressing backspace. But that won't seem to work reliably if there isn't other text before and after node.

In my opinion, most user friendly functionality would be a possibility to set cursor on row below node and then pressing backspace. Not sure if related, but if trying to move cursor up and there is an directive/image/etc node, cursor just disappears. Also, clicking directive node should make it "active", which could then be deleted from the editor using backspace.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the YouTube directive in the examples and reproduce removal in the generic editor with and without the children option. Investigate cursor movement, node selection, and Backspace behavior around directive nodes. Done means a directive can be selected or reached from the row below and removed reliably without disturbing surrounding content.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.