Skip to content

Commit

Permalink
chore: add spellCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
pubuzhixing8 committed Jun 6, 2023
1 parent 05962f5 commit e9460c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/app/richtext/richtext.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[renderElement]="renderElement"
[renderText]="renderText"
[keydown]="keydown"
[spellCheck]="true"
>
<ng-template #heading_1 let-context="context" let-viewContext="viewContext">
<h1 slateElement [context]="context" [viewContext]="viewContext"></h1>
Expand Down
4 changes: 4 additions & 0 deletions demo/app/richtext/richtext.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ export class DemoRichtextComponent implements OnInit {
};

keydown = (event: KeyboardEvent) => {
if (isHotkey('shift+enter', event)) {
event.preventDefault();
this.editor.insertText('\n');
}
for (const hotkey in HOTKEYS) {
if (isHotkey(hotkey, event as any)) {
event.preventDefault();
Expand Down

0 comments on commit e9460c0

Please sign in to comment.