Skip to content

Commit fea020a

Browse files
committed
fix(config): make config optional for scrolltotop
1 parent 142ed06 commit fea020a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/services/service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,14 @@ const makeScrollToAction = (scrollToFunc: Function) => (node: Node, options: Scr
159159
};
160160
};
161161

162+
const makeScrollToActionOptional = (scrollToFunc: Function) => (node: Node, options?: ScrollToElementOptions) => {
163+
return makeScrollToAction(scrollToFunc)(node, options);
164+
};
165+
162166
// Actions
163167
export const scrollto = makeScrollToAction(scrollTo);
164-
export const scrolltotop = makeScrollToAction(scrollToTop);
165-
export const scrolltobottom = makeScrollToAction(scrollToBottom);
168+
export const scrolltotop = makeScrollToActionOptional(scrollToTop);
169+
export const scrolltobottom = makeScrollToActionOptional(scrollToBottom);
166170

167171
// Methods
168172
export const animateScroll = {

0 commit comments

Comments
 (0)