Skip to content

Commit 2dbbdf5

Browse files
authored
fix: infinity scrolling not working correctly when selecting a value not available in the initial batch (#255)
* fix: infinity scrolling not working correctly when selecting a value not available in the initial batch #253 * fixup! fix: infinity scrolling not working correctly when selecting a value not available in the initial batch * fixup! fix: infinity scrolling not working correctly when selecting a value not available in the initial batch
1 parent c9fe435 commit 2dbbdf5

8 files changed

+318
-125
lines changed

package-lock.json

+197-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"devDependencies": {
4646
"@angular-devkit/build-angular": "~0.803.27",
47-
"@angular-extensions/lint-rules": "^1.1.1",
47+
"@angular-extensions/lint-rules": "^1.2.0",
4848
"@angular/animations": "^8.2.14",
4949
"@angular/cdk": "^8.2.3",
5050
"@angular/cli": "^8.3.27",

src/app/app.component.css

Whitespace-only changes.

src/app/app.component.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:host {
2+
display: block;
3+
margin-bottom: 200px;
4+
}

src/app/app.component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MatSelectSearchVersion } from './mat-select-search/ngx-mat-select-searc
66

77
@Component({
88
selector: 'app-root',
9-
templateUrl: 'app.component.html'
9+
templateUrl: 'app.component.html',
10+
styleUrls: ['app.component.scss']
1011
})
1112
export class AppComponent {
1213

Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
<h3>Integration with <a href="https://github.com/orizens/ngx-infinite-scroll" target="_blank">ngx-infinite-scroll</a></h3>
1+
<h3>Integration with <a href="https://github.com/HaidarZ/ng-mat-select-infinite-scroll" target="_blank">ng-mat-select-infinite-scroll</a>
2+
</h3>
23

34
<p>
4-
Selected Bank: {{ctrl?.value}}
5+
Selected Bank: {{bankCtrl?.value}}
56
</p>
67

78
<mat-form-field>
8-
<mat-select #matSelectInfiniteScroll msInfiniteScroll (infiniteScroll)="getNextBatch()"
9-
[formControl]="ctrl"
10-
placeholder="Select Something"
11-
(valueChange)="onChange($event)">
12-
<mat-option>
13-
<!--disableScrollToActiveOnOptionsChanged should be set to true-->
14-
<ngx-mat-select-search
15-
[formControl]="searchCtrl"
16-
placeholderLabel="search"
17-
[disableScrollToActiveOnOptionsChanged]="true"
18-
noEntriesFoundLabel="No entry matches">
19-
</ngx-mat-select-search>
20-
</mat-option>
21-
<mat-option *ngFor="let option of options$ | async" [value]="option">
22-
{{option}}
23-
</mat-option>
9+
<mat-select #matSelectInfiniteScroll
10+
msInfiniteScroll
11+
(infiniteScroll)="getNextBatch()"
12+
[formControl]="bankCtrl"
13+
placeholder="Select Something">
14+
<mat-option>
15+
<!--disableScrollToActiveOnOptionsChanged should be set to true-->
16+
<ngx-mat-select-search
17+
[formControl]="searchCtrl"
18+
placeholderLabel="search"
19+
[disableScrollToActiveOnOptionsChanged]="true"
20+
noEntriesFoundLabel="No entry matches">
21+
</ngx-mat-select-search>
22+
</mat-option>
23+
<mat-option *ngFor="let bank of filteredBatchedData$ | async"
24+
[value]="bank.id">
25+
{{bank.name}}
26+
</mat-option>
2427
</mat-select>
2528
</mat-form-field>

0 commit comments

Comments
 (0)