File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,9 @@ class Adapter {
149
149
calculateProperties ( ) {
150
150
let rowTop = null , topHeight = 0 ;
151
151
let topDone = false , bottomDone = false ;
152
+ const length = this . buffer . length ;
152
153
153
- for ( let i = 0 ; i < this . buffer . length ; i ++ ) {
154
+ for ( let i = 0 ; i < length ; i ++ ) {
154
155
const item = this . buffer [ i ] ;
155
156
const itemTop = item . element . offset ( ) . top ;
156
157
@@ -165,7 +166,7 @@ class Adapter {
165
166
this [ 'topVisibleScope' ] = item . scope ;
166
167
}
167
168
168
- if ( ! bottomDone && top > this . viewport . bottomVisiblePos ( ) ) {
169
+ if ( ! bottomDone && ( top >= this . viewport . bottomVisiblePos ( ) || ( i === length - 1 && this . isEOF ( ) ) ) ) {
169
170
bottomDone = true ;
170
171
this [ 'bottomVisible' ] = item . item ;
171
172
this [ 'bottomVisibleElement' ] = item . element ;
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ describe('uiScroll', function () {
27
27
28
28
expect ( scope . adapter ) . toBeTruthy ( ) ;
29
29
expect ( scope . adapter . topVisibleElement [ 0 ] . innerHTML ) . toBe ( '1: one' ) ;
30
+ expect ( scope . adapter . bottomVisibleElement [ 0 ] . innerHTML ) . toBe ( '3: three' ) ;
30
31
}
31
32
) ;
32
33
} ) ;
You can’t perform that action at this time.
0 commit comments