mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
fix conflicting keyboard shortcut for the task list
This commit is contained in:
parent
59b031c27c
commit
a5f28e421e
@ -63,7 +63,7 @@ context('/demos/Nodes/TaskList', () => {
|
|||||||
|
|
||||||
it('should make the paragraph a task list when the keyboard shortcut is pressed', () => {
|
it('should make the paragraph a task list when the keyboard shortcut is pressed', () => {
|
||||||
cy.get('.ProseMirror')
|
cy.get('.ProseMirror')
|
||||||
.trigger('keydown', { modKey: true, shiftKey: true, key: 'l' })
|
.trigger('keydown', { modKey: true, shiftKey: true, key: '9' })
|
||||||
.find('ul li')
|
.find('ul li')
|
||||||
.should('contain', 'Example Text')
|
.should('contain', 'Example Text')
|
||||||
})
|
})
|
||||||
|
@ -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` |
|
| Apply heading style 6 | `Control` `Alt` `6` | `Cmd` `Alt` `6` |
|
||||||
| Ordered list | `Control` `Shift` `7` | `Cmd` `Shift` `7` |
|
| Ordered list | `Control` `Shift` `7` | `Cmd` `Shift` `7` |
|
||||||
| Bullet list | `Control` `Shift` `8` | `Cmd` `Shift` `8` |
|
| Bullet list | `Control` `Shift` `8` | `Cmd` `Shift` `8` |
|
||||||
|
| Task list | `Control` `Shift` `9` | `Cmd` `Shift` `9` |
|
||||||
| Blockquote | `Control` `Shift` `B` | `Cmd` `Shift` `B` |
|
| Blockquote | `Control` `Shift` `B` | `Cmd` `Shift` `B` |
|
||||||
| Left align | `Control` `Shift` `L` | `Cmd` `Shift` `L` |
|
| Left align | `Control` `Shift` `L` | `Cmd` `Shift` `L` |
|
||||||
| Center align | `Control` `Shift` `E` | `Cmd` `Shift` `E` |
|
| Center align | `Control` `Shift` `E` | `Cmd` `Shift` `E` |
|
||||||
| Right align | `Control` `Shift` `R` | `Cmd` `Shift` `R` |
|
| Right align | `Control` `Shift` `R` | `Cmd` `Shift` `R` |
|
||||||
| Justify | `Control` `Shift` `J` | `Cmd` `Shift` `J` |
|
| 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` |
|
| Code block | `Control` `Alt` `C` | `Cmd` `Alt` `C` |
|
||||||
|
|
||||||
<!--| Toggle task| `Control` `Enter` | `Cmd` `Enter` | -->
|
<!--| Toggle task| `Control` `Enter` | `Cmd` `Enter` | -->
|
||||||
|
@ -28,8 +28,8 @@ This extension requires the [`TaskItem`](/api/nodes/task-item) extension.
|
|||||||
| taskList | — | Toggle a task list. |
|
| taskList | — | Toggle a task list. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
* Windows/Linux: `Control` `Shift` `L`
|
* Windows/Linux: `Control` `Shift` `9`
|
||||||
* macOS: `Cmd` `Shift` `L`
|
* macOS: `Cmd` `Shift` `9`
|
||||||
|
|
||||||
## Source code
|
## Source code
|
||||||
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)
|
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)
|
||||||
|
@ -51,7 +51,7 @@ export const TaskList = Node.create<TaskListOptions>({
|
|||||||
|
|
||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
'Mod-Shift-l': () => this.editor.commands.toggleTaskList(),
|
'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user