2017-07-10 16 views
0

@ViewChildを使用してプログラムでSelectボックスを開き、一度開いていると、従来のボタン(DoneまたはCancel)で閉じることができません。誰かが選択ポップアップを閉じる解決策を持っています。プログラムで開いた後にイオン選択を閉じる

この問題私はこのような、他に他の選択ボックスをトリガーしていたときにのみ発生します。

<ion-select #secondSelect 
    [(ngModel)]="test" 
    (ionChange)="openSecondSelect($event)"> 
    ... 
</ion-select> 

<ion-select #secondSelect>...</ion-select> 

openSecondSelect(event) { 
    this.secondSelect.open(); 
} 

答えて

1

私は一時的にsetTimeoutを

openSecondSelect(event) { 
    setTimeout(() => { 
     this.secondSelect.open(); 
    }, 1); 
} 
と私の問題を解決しました
関連する問題