Auto Changing Active Marks/Styles

I want to open up a discussion on this and see what people think “correct” behavior here is.

Currently when a new node is created, it by default has zero styles. This results in unfriendly user behavior as the user has to learn these events and reselect their styles.

Actions that “auto” remove styles:

  1. Create newline, start typing in bold, backspace to remove text
  2. Type in bold and then hit enter to get a newline.
  3. New paragraph line
  4. Exiting blockquotes
  5. New list item and existing list

I think most word processors that people are use to (google docs, microsoft word, mac Mail) only change styles for you when you change cursor locations, in which you get the styles of the text to the left of the cursor. In all other cases, you retain your active styles.

This is a fairly big issue for me as my target users are mostly non technical, so any magic or deviation from the norms makes it harder to use. I also, personally, find it frustrating when I select a style, start typing, realize a mistake, backspace and my styles are gone.


My background is in UX strategy and design, so that’s the lens I’m looking through as I think about this.

People intuit how something will behave based on their past experience. When I see a door, I anticipate that it will open on a hinge, based on my past experience with doors. When I use a form, I anticipate that hitting “tab” will jump to the next field. In either case, if the behaviour doesn’t match my expectations, it interrupts the experience and makes me frustrated.

Most users will anticipate that ProseMirror editors will behave like other word processors they’ve used before—that whichever stylistic state they turn on will stay on until they turn it off, or until they move to the cursor another location in the document.

From an UX point of view, I think this is the “correct” behaviour that we should aim to provide.