Skip to content

Commit

Permalink
[react-components] table-of-contents: add id attribute in the anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhsine committed Oct 2, 2019
1 parent e650ec3 commit b0a4670
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/react-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

## Release

### 8.0.1

#### Table of Contents

- Add `id` attribute in the anchor

### 8.0.0

#### Bookmark Widget
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@twreporter/react-components",
"version": "8.0.0",
"version": "8.0.1",
"main": "lib/index.js",
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
"author": "twreporter <developer@twreporter.org>",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/src/table-of-contents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class Anchor extends React.PureComponent {
}

render() {
const { bottomOffset, className, children, topOffset } = this.props
const { bottomOffset, className, children, id, topOffset } = this.props
return (
// set fireOnRapidScroll=false since we are not using `onEnter` and `onLeave`
<Waypoint
Expand All @@ -326,7 +326,7 @@ class Anchor extends React.PureComponent {
onPositionChange={this.handleOnPositionChange}
fireOnRapidScroll={false}
>
<div className={className} ref={this._ref}>
<div id={id} className={className} ref={this._ref}>
{children}
</div>
</Waypoint>
Expand Down

0 comments on commit b0a4670

Please sign in to comment.