File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,18 @@ export default {
2424 bind ( el , binding ) {
2525 let ctx = {
2626 scroll : debounce ( ( ) => {
27- let containerBottom , elementBottom , fire
27+ let containerBottom , elBottom
2828
2929 if ( ctx . scrollTarget === window ) {
30- elementBottom = el . getBoundingClientRect ( ) . bottom
31- fire = elementBottom < window . innerHeight
30+ elBottom = el . getBoundingClientRect ( ) . bottom
31+ containerBottom = window . innerHeight
3232 }
3333 else {
34+ elBottom = offset ( el ) . top + height ( el )
3435 containerBottom = offset ( ctx . scrollTarget ) . top + height ( ctx . scrollTarget )
35- elementBottom = offset ( el ) . top + height ( el )
36- fire = elementBottom < containerBottom
3736 }
3837
39- if ( fire ) {
38+ if ( elBottom > 0 && elBottom < containerBottom ) {
4039 ctx . scrollTarget . removeEventListener ( 'scroll' , ctx . scroll , listenOpts . passive )
4140 ctx . handler ( el )
4241 }
You can’t perform that action at this time.
0 commit comments