Skip to content

Commit

Permalink
fix(module:date-picker): resolve memory leaks (#7113)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt committed Dec 16, 2021
1 parent d9982e9 commit fe9070a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/date-picker/date-picker.component.ts
Expand Up @@ -312,7 +312,6 @@ export class NzDatePickerComponent implements OnInit, OnChanges, OnDestroy, Afte
document: Document;
inputSize: number = 12;
inputWidth?: number;
destroy$ = new Subject();
prefixCls = PREFIX_CLASS;
inputValue!: NzSafeAny;
activeBarStyle: object = {};
Expand Down Expand Up @@ -363,13 +362,13 @@ export class NzDatePickerComponent implements OnInit, OnChanges, OnDestroy, Afte
if (this.isRange && this.platform.isBrowser) {
this.nzResizeObserver
.observe(this.elementRef)
.pipe(takeUntil(this.destroy$))
.pipe(takeUntil(this.destroyed$))
.subscribe(() => {
this.updateInputWidthAndArrowLeft();
});
}

this.datePickerService.inputPartChange$.pipe(takeUntil(this.destroy$)).subscribe(partType => {
this.datePickerService.inputPartChange$.pipe(takeUntil(this.destroyed$)).subscribe(partType => {
if (partType) {
this.datePickerService.activeInput = partType;
}
Expand Down Expand Up @@ -641,7 +640,7 @@ export class NzDatePickerComponent implements OnInit, OnChanges, OnDestroy, Afte
this.inputValue = this.isRange ? ['', ''] : '';
this.setModeAndFormat();

this.datePickerService.valueChange$.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.datePickerService.valueChange$.pipe(takeUntil(this.destroyed$)).subscribe(() => {
this.updateInputValue();
});
}
Expand Down

0 comments on commit fe9070a

Please sign in to comment.