atomicdata-dev/atomic-data-browser

Consider `contenteditable`

Opened this issue · 1 comments

At this moment, I'm using textarea as input fields which only appear when a user clicks on an Element (block / paragraph). This makes text selection difficult, as the element is unmounted when the user clicks. So the user needs to click before selecting. #78

One way to improve upon this, is to use contentEditable, which allows for far richer editable elements. However, this also presents some challenges:

  • ContentEditbale + React is really complicated! I heard of some projects that have decided to just skip react, and simply use native DOM apis at this level
  • But I still want to render React components in the Document editor

contentEditable is way to much of a hassle to get right even without React. Our best bet is to use something like Slate's api to build our own custom experience or if we just want to solve the selection bug we could look at the DOM's Selection apis.