Skip to content

Commit

Permalink
fix(module: picker): fix select bug when data is a function (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
BronzeCui authored and fisherspy committed Sep 17, 2019
1 parent fde3d82 commit 26a07d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/picker/picker.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { PickerComponent } from './picker.component';
import { PickerOptions } from './picker-options.provider';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import * as _ from 'lodash';

@Directive({
selector: '[Picker], [nzm-picker]',
Expand Down Expand Up @@ -95,8 +96,10 @@ export class PickerDirective implements OnDestroy, OnInit, OnChanges, ControlVal
this.picker.instance.options.cols = value.cols.currentValue;
}
if (value.data && this.picker) {
this.picker.instance.options.data = value.data.currentValue;
this.showPicker();
if (!_.isEqual(this.picker.instance.options.data, value.data.currentValue)) {
this.picker.instance.options.data = value.data.currentValue;
this.showPicker();
}
}
}

Expand Down

0 comments on commit 26a07d7

Please sign in to comment.