Skip to content

Commit e8c58cc

Browse files
samoussbobylito
authored andcommitted
fix: pagination padding (#2866)
* feat(stories): add pagination with padding * refactor(pagination): remove default value from widget * fix(pagination): provide padding to the connector
1 parent f5d1ab1 commit e8c58cc

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

dev/app/builtin/stories/pagination.stories.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ export default () => {
1919
);
2020
})
2121
)
22+
.add(
23+
'with padding',
24+
wrapWithHits(container => {
25+
window.search.addWidget(
26+
instantsearch.widgets.pagination({
27+
container,
28+
padding: 6,
29+
})
30+
);
31+
})
32+
)
2233
.add(
2334
'without autoHideContainer',
2435
wrapWithHits(container => {

src/widgets/pagination/pagination.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default function pagination({
146146
labels: userLabels = defaultLabels,
147147
cssClasses: userCssClasses = {},
148148
maxPages,
149-
padding = 3,
149+
padding,
150150
showFirstLast = true,
151151
autoHideContainer = true,
152152
scrollTo: userScrollTo = 'body',
@@ -189,7 +189,7 @@ export default function pagination({
189189
const makeWidget = connectPagination(specializedRenderer, () =>
190190
unmountComponentAtNode(containerNode)
191191
);
192-
return makeWidget({ maxPages });
192+
return makeWidget({ maxPages, padding });
193193
} catch (e) {
194194
throw new Error(usage);
195195
}

0 commit comments

Comments
 (0)