Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

adds window.scroll() to BackToTopButton #80

Merged
merged 3 commits into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Master
## 0.0.12 - next release

- Fix a bug where `NavigationDropdown` did not appear on mobile. ([#79](https://github.com/mapbox/dr-ui/pull/79))
- Fix a bug where `BackToTopButton` did not, in fact, go back to top on mobile. ([#80](https://github.com/mapbox/dr-ui/pull/80))

## 0.0.10

Expand Down
8 changes: 5 additions & 3 deletions src/components/back-to-top-button/back-to-top-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export default class BackToTopButton extends React.Component {
<div className="block mx24 my24 z5">
<IconButton
onClick={() => {
document.documentElement.scrollTop = 0;
document.documentElement.scrollTop = 0; // fallback
window.scroll({
top: 0,
left: 0
});
}}
icon="arrow-up"
tooltipProps={{
Expand All @@ -22,5 +26,3 @@ export default class BackToTopButton extends React.Component {
);
}
}

// {/* none-mm fixed bottom right */}