Pressing the return key when editing page title splits the title

Steps to reproduce:

  • click on a page title that you have permission to edit (title must be 2 or more characters)
  • move the cursor so there is text on either side
  • press enter

behavior

the title is updated to the text to the left of the cursor, and a new node is made below the cursor containing the text that was on the right of the cursor.

This is how editing most nodes works, but md-version behaves very differently when editing a title (a way I much prefer), so I consider this a bug.

Expected behavior

At the least; edit mode is exited. Equivalent to pressing the escape key twice.

Ideally (in my opinion), editing the title should be like in the md-version, but I would go a step further to signify to the user that their changes aren’t accepted until they hit enter. IDEs do this well when it comes to renaming a variable, as do file managers when it comes to renaming a file.

Arguably this is a feature request and not a bug, but it’s sufficiently different from what I expected that I’d call it a bug.

yeah this is a db version issue, not just preference. title is being treated like a normal node, so enter triggers a split which doesn’t make sense for a title field.

in md-version, enter = commit, escape = cancel… way more intuitive. this should be handled at the editor level by overriding enter for title editing. feels like a legit bug, not a feature.

Personally I hope this is the desired behaviour, since it properly reflects the fact that Pages are simply nodes with the Page tag (which is super elegant).

I can see a sort of elegance there for sure.

However, I just realized the current behavior still treats it special: I pressed return (thereby splitting it up as described) and then backspace… Backspace didn’t do anything! If it was being treated like any other node, backspace would be equivalent to an ‘undo’ command.

Good point

You’re right. Either allow breaking, but also undoing by backspace, or don’t allow breaking. I’d call that a minor bug even.