Skip to content

Commit e621c94

Browse files
committed
fix: modified the scroll event
1 parent 3c10762 commit e621c94

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/apps/talent-search/src/routes/search-results-page/SearchResultsPage.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const SearchResultsPage: FC = () => {
3636
const visibleHeight = window.innerHeight
3737
const fullHeight = document.body.scrollHeight
3838

39-
if (scrollY + visibleHeight >= fullHeight - 100) {
39+
// negating 763px since footer occupies at least 600px
40+
if (scrollY + visibleHeight >= fullHeight - 763) {
4041
// Scroll near bottom
4142
setCurrentPage(prev => {
4243
const maxPages = Math.ceil(matches.length / itemsPerPage)
@@ -49,10 +50,6 @@ const SearchResultsPage: FC = () => {
4950
return () => window.removeEventListener('scroll', handleScroll)
5051
}, [matches])
5152

52-
useEffect(() => {
53-
setCurrentPage(1)
54-
}, [skills, matches])
55-
5653
const toggleSkillsModal = useCallback(() => setShowSkillsModal(s => !s), [])
5754

5855
const skillsModalTriggerBtn = (

0 commit comments

Comments
 (0)