mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
fix(mobile): screens with pull-to-refresh bounce like every other iOS list
The dashboard, journeys and notifications switched the iOS bounce off entirely so it would not race the pull. The pull now holds only a clearly downward move from the very top, from its first pixel, and the page bounces everywhere else, its end included. TestFlight feedback, 5.1.3.
This commit is contained in:
@@ -92,4 +92,23 @@ describe('usePullToRefresh', () => {
|
||||
touch('touchend');
|
||||
expect(onRefresh).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('holds a clearly downward move at the top from its first pixel, so the bounce does not start under the pull', () => {
|
||||
setup();
|
||||
touch('touchstart', 100, 100);
|
||||
expect(touch('touchmove', 100, 103).defaultPrevented).toBe(true);
|
||||
touch('touchend');
|
||||
});
|
||||
|
||||
it('leaves the bounce everywhere else: a sideways start, and the page once it is scrolled', () => {
|
||||
setup();
|
||||
touch('touchstart', 100, 100);
|
||||
expect(touch('touchmove', 104, 102).defaultPrevented).toBe(false);
|
||||
touch('touchend');
|
||||
Object.defineProperty(window, 'scrollY', { value: 300, configurable: true });
|
||||
touch('touchstart', 100, 100);
|
||||
expect(touch('touchmove', 100, 103).defaultPrevented).toBe(false);
|
||||
touch('touchend');
|
||||
expect(document.documentElement.hasAttribute('data-pull-refresh')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user