Skip to content

Commit

Permalink
fix(ngx-jodit): reactive form gets dirty after (value) initialization
Browse files Browse the repository at this point in the history
Merge pull request #28 from gschafra/fix/reactive_form_gets_initially_dirty
  • Loading branch information
julianpoemp authored Jan 25, 2024
2 parents bfd6bdf + 0761464 commit fd2a344
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions libs/ngx-jodit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 2 additions & 3 deletions libs/ngx-jodit/src/lib/ngx-jodit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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);
}
});
}
Expand Down

0 comments on commit fd2a344

Please sign in to comment.