Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues navigating between the new title and the editor body. #8191

Closed
4 of 6 tasks
disordinary opened this issue Mar 20, 2017 · 3 comments
Closed
4 of 6 tasks

Issues navigating between the new title and the editor body. #8191

disordinary opened this issue Mar 20, 2017 · 3 comments
Assignees
Labels
affects:editor Work relating to the Koenig Editor bug [triage] something behaving unexpectedly

Comments

@disordinary
Copy link
Contributor

disordinary commented Mar 20, 2017

The multi line title has bugs when navigating between the title and editor.

  • Tab stops not working.
  • Split title into content when enter is pressed (required to create a paragraph if a card is the first element)
  • Combine the first paragraph into the title if backspace is pressed in the editor.
  • When you press down and are on the first character of the line in the title the cursor moves to the end of the line in the title rather than the first character in the editor.
  • When you press right from the last character of the title or left from the first character of the editor you don't navigate from the title to the body or vice versa.
  • When you press up from the editor the cursor moves to the first character of the title. The code is in there but each browser has different issues so it's commented out.
@disordinary disordinary changed the title Multi line title Issues navigating between the new title and the editor body. Mar 20, 2017
@kirrg001 kirrg001 added this to the 1.0.0 Beta Ready milestone Mar 20, 2017
@ErisDS ErisDS added the affects:editor Work relating to the Koenig Editor label Mar 20, 2017
disordinary added a commit to disordinary/Ghost-Admin that referenced this issue Mar 30, 2017
Refs: TryGhost/Ghost#8191
Refs: TryGhost/Ghost#8194

Changes the selection behaviour of mobiledoc-cards:
If you navigate to a card with a keyboard or click on the new editor toolbar it "hard selects".
If you click into the body of a card to edit it it "soft selects".

When a card is "hard selected" you can navigate out of the card and to the previous or following blocks within the mobiledoc with the keyboard, you can delete the current card with the backspace or delete button, and you can create a new block following the card with the enter key.

When a card is soft selected it is simply displayed as selected and allows the user to edit content within the card.

New card toolbar:
Allows a user to delete the card, save the card, and "hard select" a card.

New title behaviour:
Pressing the enter key within the title "splits" the title at the cursor point, if multiple characters are selected they are first deleted, and creates a new paragraph at the top of the document with the trailing characters after the split.

gh-cm-editor updates:
Adds an on-focus event to gh-cm-editor
disordinary added a commit to disordinary/Ghost-Admin that referenced this issue Mar 30, 2017
Refs: TryGhost/Ghost#8191
Refs: TryGhost/Ghost#8194

Changes the selection behaviour of mobiledoc-cards:
If you navigate to a card with a keyboard or click on the new editor toolbar it "hard selects".
If you click into the body of a card to edit it it "soft selects".

When a card is "hard selected" you can navigate out of the card and to the previous or following blocks within the mobiledoc with the keyboard, you can delete the current card with the backspace or delete button, and you can create a new block following the card with the enter key.

When a card is soft selected it is simply displayed as selected and allows the user to edit content within the card.

New card toolbar:
Allows a user to delete the card, save the card, and "hard select" a card.

New title behaviour:
Pressing the enter key within the title "splits" the title at the cursor point, if multiple characters are selected they are first deleted, and creates a new paragraph at the top of the document with the trailing characters after the split.

gh-cm-editor updates:
Adds an on-focus event to gh-cm-editor
kevinansfield pushed a commit to disordinary/Ghost-Admin that referenced this issue Mar 30, 2017
Refs: TryGhost/Ghost#8191
Refs: TryGhost/Ghost#8194

Changes the selection behaviour of mobiledoc-cards:
If you navigate to a card with a keyboard or click on the new editor toolbar it "hard selects".
If you click into the body of a card to edit it it "soft selects".

When a card is "hard selected" you can navigate out of the card and to the previous or following blocks within the mobiledoc with the keyboard, you can delete the current card with the backspace or delete button, and you can create a new block following the card with the enter key.

When a card is soft selected it is simply displayed as selected and allows the user to edit content within the card.

New card toolbar:
Allows a user to delete the card, save the card, and "hard select" a card.

New title behaviour:
Pressing the enter key within the title "splits" the title at the cursor point, if multiple characters are selected they are first deleted, and creates a new paragraph at the top of the document with the trailing characters after the split.

gh-cm-editor updates:
Adds an on-focus event to gh-cm-editor
kevinansfield pushed a commit to TryGhost/Admin that referenced this issue Mar 30, 2017
Refs: TryGhost/Ghost#8191
Refs: TryGhost/Ghost#8194

Changes the selection behaviour of mobiledoc-cards:
If you navigate to a card with a keyboard or click on the new editor toolbar it "hard selects".
If you click into the body of a card to edit it it "soft selects".

When a card is "hard selected" you can navigate out of the card and to the previous or following blocks within the mobiledoc with the keyboard, you can delete the current card with the backspace or delete button, and you can create a new block following the card with the enter key.

When a card is soft selected it is simply displayed as selected and allows the user to edit content within the card.

New card toolbar:
Allows a user to delete the card, save the card, and "hard select" a card.

New title behaviour:
Pressing the enter key within the title "splits" the title at the cursor point, if multiple characters are selected they are first deleted, and creates a new paragraph at the top of the document with the trailing characters after the split.

gh-cm-editor updates:
Adds an on-focus event to gh-cm-editor
@ErisDS
Copy link
Member

ErisDS commented Mar 30, 2017

The tab key doesn't work to get me from the title to the editor.

I personally would have thought the use case for this was much, much stronger than arrow keys?

Update: the tab key seems to cause some quite weird behaviour. Sometimes the cursor just stays, sometimes it disappears. After hitting tab the down key doesn't work for transitioning, but I can still type.

disordinary added a commit to disordinary/Ghost-Admin that referenced this issue Apr 3, 2017
Refs: TryGhost/Ghost#8191
Refs: TryGhost/Ghost#8194

Changes the selection behaviour of mobiledoc-cards:
If you navigate to a card with a keyboard or click on the new editor toolbar it "hard selects".
If you click into the body of a card to edit it it "soft selects".

When a card is "hard selected" you can navigate out of the card and to the previous or following blocks within the mobiledoc with the keyboard, you can delete the current card with the backspace or delete button, and you can create a new block following the card with the enter key.

When a card is soft selected it is simply displayed as selected and allows the user to edit content within the card.

New card toolbar:
Allows a user to delete the card, save the card, and "hard select" a card.

New title behaviour:
Pressing the enter key within the title "splits" the title at the cursor point, if multiple characters are selected they are first deleted, and creates a new paragraph at the top of the document with the trailing characters after the split.

gh-cm-editor updates:
Adds an on-focus event to gh-cm-editor
@disordinary
Copy link
Contributor Author

I spent longer than I care to admit on

When you press up from the editor the cursor moves to the first character of the title. The code is in there but each browser has different issues so it's commented out.

It works fine in isolation but doesn't work in ghost-admin for some reason. The cursor is supposed to be positioned at the character that is closest to the character selected in the body when you press the "up" arrow. In chrome it just goes to the start of the title, in firefox it goes to the correct position but then you can't edit the title afterwards. Investigation needs to be done to see if it's something to do with ember / ghost-admin or mobiledoc, but it's an edge case so investigation will stop until after the first beta.

@ErisDS ErisDS added the bug [triage] something behaving unexpectedly label Apr 11, 2017
@disordinary
Copy link
Contributor Author

I've been experimenting with this over the last day and I think functionality needs to be removed.

If you press enter the title splits into the body, and in reverse pressing backspace in the body combines the first body paragraph with the title.

This works well, however because the title is not integrated in the editors undo queue and won't be without a large re-write of mobiledoc (which is planned in the medium term for other reasons), then the behaviour doesn't work as expected.

Pressing enter on the title to create a new paragraph in the editor is a necessary evil because the first element may be a card, however I think that it's better to just create a new empty paragraph rather than split the title. This behaviour may be a little odd but not as odd as having a broken undo system.

This means that this issue is now simply about navigation between the title and body with either the up and down keys (I don't think left and right should be used so that we clearly have different fields), the enter key, and the tab key.

kevinansfield pushed a commit to TryGhost/Admin that referenced this issue Apr 20, 2017
closes TryGhost/Ghost#8323
closes TryGhost/Ghost#8191

Fixes some of the range issues that we're seeing across browsers also simplifies the positioning code for UI elements.
1. For the title the cursor is now placed in the correct place on key up and down.
2. For the body Safari now displays the `/` menu correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:editor Work relating to the Koenig Editor bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

3 participants