Skip to content

Commit

Permalink
fix: don't override behaviour of Home / End in pc keymap
Browse files Browse the repository at this point in the history
Similarly removed in Prosemirror at ProseMirror/prosemirror-commands@20371c58

For users who wish to preserve this behaviour, they can achieve this via:

```javascript
const CustomKeyboardBehaviour = Extension.create({
  addKeyboardShortcuts() {
    return {
      ['Home']: () => this.editor.commands.selectTextblockStart(),
      ['End']: () => this.editor.commands.selectTextblockEnd(),
    }
  }
})

const editor = new Editor({
  extensions: [
    // Register your custom extension with the editor.
    CustomKeyboardBehaviour,
  ]
});
```
  • Loading branch information
Scott Sidwell committed Apr 8, 2022
1 parent ab4a0e2 commit d270419
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/core/src/extensions/keymap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ export const Keymap = Extension.create({

const pcKeymap = {
...baseKeymap,
Home: () => this.editor.commands.selectTextblockStart(),
End: () => this.editor.commands.selectTextblockEnd(),
}

const macKeymap = {
Expand Down

0 comments on commit d270419

Please sign in to comment.