# Cannot select/edit on custom nodes with Text content

**URL:** <https://discuss.prosemirror.net/t/cannot-select-edit-on-custom-nodes-with-text-content/380>\
**Category:** Uncategorized\
**Created:** [August 8, 2016, 9:19am UTC](https://discuss.prosemirror.net/t/cannot-select-edit-on-custom-nodes-with-text-content/380 "2016-08-08T09:19:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsaccon](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/rsaccon/32/70_2.png) [@rsaccon](https://discuss.prosemirror.net/u/rsaccon)\
**Post date:** [August 8, 2016, 9:19am UTC](https://discuss.prosemirror.net/t/cannot-select-edit-on-custom-nodes-with-text-content/380/1 "2016-08-08T09:19:57Z")

</div>

I guess something is wrong with the way I try to define an Inline custom node with an editable text content child:

```
class Foo extends Inline {
  get matchDOMTag() {
    return { 'foo': dom => (false) }
  }
  toDOM(node) {
    return ['div', {style:'background-color:yellow;'}, 0]
  }
}

```

and then I add it to my schema:

```
const schema = new Schema({
  nodes: {
    doc: {type: Doc, content: 'block+'},
    paragraph: {type: Paragraph, content: 'inline<_>*', group: 'block'}, 
    .....   
    foo: {type: Foo, content: "text<_>*", group: 'inline'},
    ...
  },
  marks: {
    ...
  }
})

```

My actual use case is a Figure with an editable figcaption, and there I face the same problem as in this simple example. The figures needs to be of type `Inline`, because they are CSS floating inside a paragraph. If I define my figure as type `Block`, then I can edit the text content. But then the figure cannot go anymore inside a paragraph.

Or can I explicitly allow paragraphs to accept figures as content (even it they extend `Block` class) ?

Another option of course is to edit the fig caption with a prompt dialog (when clicking on the figcaption node), but I would prefer to have the figcaption text editable directly.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [August 13, 2016, 8:37pm UTC](https://discuss.prosemirror.net/t/cannot-select-edit-on-custom-nodes-with-text-content/380/2 "2016-08-13T20:37:18Z")

</div>

Inline nodes that aren’t leaf nodes is something I’d like to support (see [114](https://github.com/ProseMirror/prosemirror/issues/114)), but haven’t ever tested or worked on yet, so it’s likely still broken in a number of ways.

---

<div class="post-metadata">

**Author:** ![rsaccon](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/rsaccon/32/70_2.png) [@rsaccon](https://discuss.prosemirror.net/u/rsaccon)\
**Post date:** [August 15, 2016, 7:53pm UTC](https://discuss.prosemirror.net/t/cannot-select-edit-on-custom-nodes-with-text-content/380/3 "2016-08-15T19:53:57Z")

</div>

Ok, I am definitely interested in getting support for inline nodes with content. Until then I guess I need to make the content editable with a prompt dialog.
