Skip to content

Commit 41e42d3

Browse files
committed
put offset props back to number for compatability
1 parent ceab719 commit 41e42d3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Props that can be passed to Component `ScrollspyNav` for configuration.
6060
| Name | Type | Description | Example Value |
6161
|------|------|------| ------ |
6262
| scrollTargetIds | Array | List of scroll targets ids | ["section_1", "section_2", "section_3"] |
63-
| offset | String | offset pixels to the scrollTargetIds | "100" |
63+
| offset | Number | offset pixels to the scrollTargetIds. Default is 0 | 100 |
6464
| activeNavClass | String | Class name for styling the nav link that's currently active | "is-active" |
6565
| scrollDuration | String | Scroll duration for controlling how fast the nav click scrolls to its section. Default is "1000" | "1000" |
6666
| headerBackground | String | If header has background color or not, for accurate scroll position, Default is "false" | "true" |

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ScrollspyNav extends Component {
99
this.activeNavClass = this.props.activeNavClass;
1010
this.scrollDuration = Number(this.props.scrollDuration) || 1000;
1111
this.headerBackground = this.props.headerBackground === "true" ? true : false;
12-
this.offset = Number(this.props.offset) || 0;
12+
this.offset = this.props.offset || 0;
1313

1414
if(this.props.router && this.props.router === "HashRouter") {
1515
this.homeDefaultLink = "#/";

0 commit comments

Comments
 (0)