fix conflicting keyboard shortcut for the task list

This commit is contained in:
Hans Pagel 2021-03-24 20:39:56 +01:00
parent 59b031c27c
commit a5f28e421e
4 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ context('/demos/Nodes/TaskList', () => {
it('should make the paragraph a task list when the keyboard shortcut is pressed', () => {
cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, shiftKey: true, key: 'l' })
.trigger('keydown', { modKey: true, shiftKey: true, key: '9' })
.find('ul li')
.should('contain', 'Example Text')
})

View File

@ -43,12 +43,12 @@ Most of the core extensions register their own keyboard shortcuts. Depending on
| Apply heading style 6 | `Control` `Alt` `6` | `Cmd` `Alt` `6` |
| Ordered list | `Control` `Shift` `7` | `Cmd` `Shift` `7` |
| Bullet list | `Control` `Shift` `8` | `Cmd` `Shift` `8` |
| Task list | `Control` `Shift` `9` | `Cmd` `Shift` `9` |
| Blockquote | `Control` `Shift` `B` | `Cmd` `Shift` `B` |
| Left align | `Control` `Shift` `L` | `Cmd` `Shift` `L` |
| Center align | `Control` `Shift` `E` | `Cmd` `Shift` `E` |
| Right align | `Control` `Shift` `R` | `Cmd` `Shift` `R` |
| Justify | `Control` `Shift` `J` | `Cmd` `Shift` `J` |
| Task list | `Control` `Shift` `L` | `Cmd` `Shift` `L` (TODO: Conflict!) |
| Code block | `Control` `Alt` `C` | `Cmd` `Alt` `C` |
<!--| Toggle task| `Control`&nbsp;`Enter` | `Cmd`&nbsp;`Enter` | -->

View File

@ -28,8 +28,8 @@ This extension requires the [`TaskItem`](/api/nodes/task-item) extension.
| taskList | — | Toggle a task list. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`L`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`L`
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`9`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`9`
## Source code
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)

View File

@ -51,7 +51,7 @@ export const TaskList = Node.create<TaskListOptions>({
addKeyboardShortcuts() {
return {
'Mod-Shift-l': () => this.editor.commands.toggleTaskList(),
'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),
}
},
})