question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Home/End buttons don't move the cursor to the start/end of the text line

See original GitHub issue

What’s the bug you are facing?

A GIF is worth a thousand words…

Here’s the correct behavior on ProseMirror when I press the Home/End buttons: PowerToys_nLzUakpn1o

How can we reproduce the bug on our side?

If you try the same thing on Tiptap’s default example, Home/End sends you to the start/end of the paragraph node, not the text like like ProseMirror does: PowerToys_B535p4Lsa9

Can you provide a CodeSandbox?

No response

What did you expect to happen?

I expect Home/End buttons to work like in the ProseMirror demo.

That’s how the browser <textarea> works, that’s how Microsoft Word / Google Docs / Dropbox Paper works, and probably many other editors like Tiptap (I tried Slate, and it worked as expected).

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖 (on behalf of Doist)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
scottsidwellcommented, Apr 8, 2022

In an attempt to drive this bug to resolution, I’ve created a PR that mirrors the ProseMirror change and removes the Home/End keybindings from the pc keymaps. https://github.com/ueberdosis/tiptap/pull/2691

Users that relied on this behaviour can use the exported this.editor.commands.selectTextblockStart() / this.editor.commands.selectTextblockEnd() and a custom extension to achieve this non-standard behaviour.

If we haven’t reached consensus on this change, then feel free to ignore. Just raising the PR in case this is all that’s missing to resolve the issue.

4reactions
rfgamaralcommented, Apr 6, 2022

@philippkuehn The current Tiptap behavior doesn’t seem like the standard behavior for any other editor that I’ve tried, even for word processing editors like Google Docs, Dropbox Paper, and Microsoft Word. Do you think we could have those bindings removed from Tiptap as well?

For more context, we have a lot of user reports saying that Home/End buttons no longer work as they expect, so this is definitely an issue for users. But only for Windows users, because the issue does not exist for macOS users. Although typical Apple keyboards don’t have Home/End buttons, Apple users with PC keyboards don’t have this problem because the Home/End keybindings are only being overwritten for PC users, which is inconsistent.

What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the Home and End Buttons for an External ...
How to Fix the Home and End Buttons for an External Keyboard in Mac · 1. Open a terminal. You can access it...
Read more >
macos - Remap "Home" and "End" to beginning and end of line
Note that this covers both the normal action of moving the cursor and the Shift + Home / End combination to select durring...
Read more >
How do I go to the end of a line in VS code without using the ...
Ctrl + K Ctrl + S (to open key bindings); Search for "cursorDown"; Highlight the row and press ENTER; Press Shift + Space....
Read more >
Keyboard basics: Move the cursor and select text ... - YouTube
Don't forget to and subscribe to my channel for more content: ... of line Ctrl + Home / End - Move to start...
Read more >
Word>Why won't up and down work like home and end ...
No, pressing the Up arrow doesn't move the insertion point to the beginning of the line. The Up arrow key doesn't work like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found