diff --git a/src/connectors/range/__tests__/connectRange-test.ts b/src/connectors/range/__tests__/connectRange-test.ts index 4d6846272b..690fd9113d 100644 --- a/src/connectors/range/__tests__/connectRange-test.ts +++ b/src/connectors/range/__tests__/connectRange-test.ts @@ -667,6 +667,22 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/range-input return helper; }; + it('resets the page', () => { + const helper = createHelper(); + helper.setPage(5); + const widget = connectRange(rendering)({ + attribute, + }); + + const { refine } = widget.getWidgetRenderState( + createInitOptions({ helper }) + ); + + refine([10, 490]); + + expect(helper.state.page).toBe(0); + }); + it('expect to refine when range are not set', () => { const helper = createHelper(); const widget = connectRange(rendering)({ diff --git a/src/connectors/range/connectRange.ts b/src/connectors/range/connectRange.ts index d085463b42..567aac2897 100644 --- a/src/connectors/range/connectRange.ts +++ b/src/connectors/range/connectRange.ts @@ -242,7 +242,7 @@ const connectRange: RangeConnector = function connectRange( ); } - return resolvedState; + return resolvedState.resetPage(); } return null;