Skip to content

Commit e4b83b4

Browse files
committed
fix for not reliable updating progress; JetBrains files in .gitignore; updated changelog
1 parent e19ec08 commit e4b83b4

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dist
99

1010
# misc
1111
.DS_Store
12+
.idea
1213
.env
1314
.env.local
1415
.env.development.local

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ This file includes all notable changes made to this project (since `v2.4.0`. Bef
55
The format of this file is from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
66
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.4.2]
9+
10+
### Changed
11+
12+
- Fix for not reliable updating progress of the Step component (#108)
13+
814
## [2.4.0]
915

1016
### Added

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scrollama",
3-
"version": "2.4.1",
3+
"version": "2.4.2",
44
"description": "A lightweight scrollytelling interface for React using the IntersectionObserver.",
55
"author": "",
66
"license": "MIT",

src/Step.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
// prettier-ignore
2-
import React, { useState, useMemo, useCallback, useRef, useEffect, cloneElement } from 'react';
2+
import React, {
3+
cloneElement,
4+
useCallback,
5+
useEffect,
6+
useMemo,
7+
useRef,
8+
useState,
9+
} from 'react';
310
import { useInView } from 'react-intersection-observer';
411

512
const useRootMargin = offset => {
@@ -31,7 +38,7 @@ const Step = props => {
3138

3239
const isBrowser = typeof window !== 'undefined';
3340
const scrollTop = isBrowser ? document.documentElement.scrollTop : 0;
34-
const direction = lastScrollTop > scrollTop ? 'up' : 'down';
41+
const direction = lastScrollTop >= scrollTop ? 'up' : 'down';
3542

3643
const rootMargin = useRootMargin(offset);
3744

0 commit comments

Comments
 (0)