Angular15中ngx-infinite-scroll与mat-select结合时滚动事件未触发问题
Angular 15 + Legacy Angular Material 下 ngx-infinite-scroll 与 mat-select 集成问题
我在用Angular v15和Legacy Angular Material,想实现ngx-infinite-scroll和mat-select/mat-option的配合使用。之前用的ng-mat-select-infinite-scroll适配不了Legacy版本的Material,所以换成了ngx-infinite-scroll。但配置完HTML代码后,scrollDown()方法完全没被触发,还出现了两个滚动条,明显是配置有问题。
相关代码
<mat-select panelClass="lazyloadselector" [formControl]="appselect" [complete]="offset === tempOptions.length" (openedChange)="openChanged($event)" [disabled]="disabled" (selectionChange)="selectionChangedTrigger($event)"> <mat-option unselectable="on" [disabled]="true"> <input type="text" (keyup)="onKeyUp($event)" placeholder="Search..." #input (keydown.space)="$event.stopPropagation()"> </mat-option> <div class="search-results" infiniteScroll infinite-scroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="150" (scrolled)="scrollDown()"> <mat-option *ngFor="let option of tempInfiniteScrollOptions" [value]="option.value">{{option.viewValue}} </mat-option> </div> </mat-select>
异常滚动条截图

内容的提问来源于stack exchange,提问作者Nelleke Rietvink
相关产品推荐
相关产品推荐

