Skip to content

Commit

Permalink
fix: update view on selection update (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
tutkli authored Dec 10, 2023
1 parent 4dab97a commit 681dc85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions projects/ngx-tiptap/src/lib/editor.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export class EditorDirective implements OnInit, AfterViewInit, ControlValueAcces

// register update handler to listen to changes on update
this.editor.on('update', this.handleChange);

// Needed for ChangeDetectionStrategy.OnPush to get notified
this.editor.on('selectionUpdate', () => this.changeDetectorRef.markForCheck())
}

ngAfterViewInit(): void {
Expand Down

0 comments on commit 681dc85

Please sign in to comment.