Skip to content

Commit

Permalink
fix(module: picker): fix asyn picker data need to update selected data (
Browse files Browse the repository at this point in the history
  • Loading branch information
Guoyuanqiang authored and fisherspy committed Mar 15, 2019
1 parent e9ae898 commit fbcc0cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion components/core/services/popup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class PopupService {
PopupService.hidePopup();
});
PopupService.currentServiceName = componentName;
console.log(component, childInjector);
const comRef = PopupService.overlayRef.attach(new ComponentPortal(component, undefined, childInjector));
PopupService.serviceArray.push({key: componentName, value: PopupService.overlayRef});
return comRef;
Expand Down
7 changes: 7 additions & 0 deletions components/picker/picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ export class PickerComponent implements OnInit, AfterViewInit, OnDestroy {
const a = this.dataForRender.slice(0, target + 1);
this.dataForRender = a;
this.checkArrayDeep(this.dataForRender[target][index]);
if (this.selectedTarget.length > 0 && this.selectedTarget.length < this.dataForRender.length) {
for (let i = 0; i < this.dataForRender.length; i++) {
if (target !== i) {
this.selectedTarget.push({ targetId: `${i}`, currentY: 0 });
}
}
}
setTimeout(() => {
this.dataForRender.forEach((item, i) => {
if (target !== `${i}` && i > target) {
Expand Down

0 comments on commit fbcc0cf

Please sign in to comment.