@@ -145,8 +145,8 @@ export function useScroll(
145
145
} )
146
146
const scrollContainer
147
147
= ( _element as Window ) ?. document ?. documentElement
148
- || ( _element as Document ) ?. documentElement
149
- || ( _element as Element )
148
+ || ( _element as Document ) ?. documentElement
149
+ || ( _element as Element )
150
150
if ( x != null )
151
151
internalX . value = scrollContainer . scrollLeft
152
152
if ( y != null )
@@ -198,8 +198,8 @@ export function useScroll(
198
198
directions . left = scrollLeft < internalX . value
199
199
directions . right = scrollLeft > internalX . value
200
200
201
- const left = ( scrollLeft * directionMultipler ) <= ( offset . left || 0 )
202
- const right = ( scrollLeft * directionMultipler )
201
+ const left = Math . abs ( scrollLeft * directionMultipler ) <= ( offset . left || 0 )
202
+ const right = Math . abs ( scrollLeft * directionMultipler )
203
203
+ el . clientWidth >= el . scrollWidth
204
204
- ( offset . right || 0 )
205
205
- ARRIVED_STATE_THRESHOLD_PIXELS
@@ -223,8 +223,8 @@ export function useScroll(
223
223
224
224
directions . top = scrollTop < internalY . value
225
225
directions . bottom = scrollTop > internalY . value
226
- const top = scrollTop <= ( offset . top || 0 )
227
- const bottom = scrollTop
226
+ const top = Math . abs ( scrollTop ) <= ( offset . top || 0 )
227
+ const bottom = Math . abs ( scrollTop )
228
228
+ el . clientHeight >= el . scrollHeight
229
229
- ( offset . bottom || 0 )
230
230
- ARRIVED_STATE_THRESHOLD_PIXELS
0 commit comments