forked from zammad/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: Mobile - Add actual line breaks on "Enter"
- Loading branch information
1 parent
74c76bf
commit 1e1af93
Showing
10 changed files
with
76 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/frontend/shared/components/Form/fields/FieldEditor/extensions/HardBreakParagraph.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import HardBreak from '@tiptap/extension-hard-break' | ||
|
||
export default HardBreak |
15 changes: 15 additions & 0 deletions
15
app/frontend/shared/components/Form/fields/FieldEditor/extensions/HardBreakSimple.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import HardBreak from '@tiptap/extension-hard-break' | ||
|
||
export default HardBreak.extend({ | ||
addKeyboardShortcuts() { | ||
return { | ||
// by default "Enter" doesn't add an actual line break, only "visible" break. | ||
// actual line break is added with "Shift+Enter", which is not very intuitive, | ||
// so we are rewriting it for out implementation to also use "Enter" for line break | ||
// WARNING: this should not be used for HTML editor as it causes bugs with other extensions | ||
Enter: () => this.editor.commands.setHardBreak(), | ||
} | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters