Closed user97116 closed 5 months ago
Expect behaviour -> when it visible onVisibiltyChanged it must called Actual behaviour -> when it visible onVisibiltyChanged not called
onVisibilityChanged callback not working when scrolling faster @jamesderlin
Can you clarify exactly what "not working" means? What behavior did you expect to happen, and what behavior did you actually observe?
@jamesderlin
I'm not exactly sure what I'm supposed to be observing, but if you're complaining that when scrolling quickly such that a hidden VisibilityDetector
momentarily becomes visible, becomes hidden again, and does not fire any callback, then that's intended behavior. (Conversely, if a VisibilityDetector
is visible, momentarily becomes hidden, and then becomes visible again, it also will not fire a callback.)
From the README
:
Callbacks are not fired immediately on visibility changes. Instead, callbacks are deferred and coalesced such that the callback for each
VisibilityDetector
will be invoked at most once perVisibilityDetectorController.updateInterval
You can decrease VisibilityDetectorController.updateInterval
(the default value is 500 ms), even to 0, although decreasing it too much could negatively impact your application performance.
Details?