From 07614646f931448c437c10dc9cb7ca9d619e0af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Schafranek?= Date: Wed, 24 Jan 2024 23:44:07 +0100 Subject: [PATCH] fix: reactive form gets dirty after (value) initialization --- libs/ngx-jodit/package.json | 1 + libs/ngx-jodit/src/lib/ngx-jodit.component.ts | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ngx-jodit/package.json b/libs/ngx-jodit/package.json index 31e1235..6a83845 100644 --- a/libs/ngx-jodit/package.json +++ b/libs/ngx-jodit/package.json @@ -5,6 +5,7 @@ "peerDependencies": { "@angular/common": ">=16.0.0", "@angular/core": ">=16.0.0", + "@angular/forms": ">=16.0.0", "jodit": "^4.0.0" }, "author": { diff --git a/libs/ngx-jodit/src/lib/ngx-jodit.component.ts b/libs/ngx-jodit/src/lib/ngx-jodit.component.ts index 8f62171..49f17cb 100644 --- a/libs/ngx-jodit/src/lib/ngx-jodit.component.ts +++ b/libs/ngx-jodit/src/lib/ngx-jodit.component.ts @@ -6,15 +6,15 @@ import { Component, ElementRef, EventEmitter, - forwardRef, Input, OnDestroy, Output, ViewChild, + forwardRef, } from '@angular/core'; import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Jodit } from 'jodit'; -import { BehaviorSubject, combineLatest, delay, distinctUntilChanged, filter, merge, Subscription, withLatestFrom } from 'rxjs'; +import { BehaviorSubject, Subscription, combineLatest, delay, distinctUntilChanged, filter, withLatestFrom } from 'rxjs'; import { JoditConfig } from './types'; @@ -98,7 +98,6 @@ export class NgxJoditComponent implements ControlValueAccessor, AfterViewInit, O ).subscribe(([[_, initialized], text]) => { if (this.jodit && initialized) { this.jodit.value = text; - this.onChange(text); } }); }