How do I select something in the editor


I started to work on ProseMirror one week ago and I still can’t find an example or an explanation about how to make a selection in the document.

For example:

  • how do I make some text selection with my trackpad when I highlight some text ?
  • Is it possible to ask the editorView or the editorState to search for the surrounding inline node, then the nearest node wrapping around the current position of my cursor ?

Is it a plugin that need to include in my editorView ?

Thanks for any help.

When you highlight text you are making a selection. I don’t really understand your other question but it sound like you should start by reading the documentation.

Hello @marijn

I found solutions to the problems I had. The difficulties I encountered come from the fact that I’m not using a pure javascript implementation of ProseMirror as I’m on Svelte. I’m reading your documentation a lot but it is not straightforward to translate some examples you provided in Svelte, like translating the class implementation to Svelte Components or breaking the editor in smaller components.

I know tiptap exists for Svelte but I want to be able to have a different editing interface in place of the menu buttons.