diff options
author | 2021-01-16 22:28:02 +0300 | |
---|---|---|
committer | 2021-01-16 22:28:02 +0300 | |
commit | 74e1cf9f3be47b85a8a29c46786b4a839f977eee (patch) | |
tree | 780d0e902e65d88effbab2a965fa2dc9a13d2a73 | |
parent | Lock textarea resizing to vertical (diff) |
Polyfills Smooth Scroll
Pollyfills smooth scroll on the scroll to top button.
Signed-off-by: Hassan Abouelela <[email protected]>
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/components/ScrollToTop.tsx | 3 | ||||
-rw-r--r-- | yarn.lock | 10 |
3 files changed, 15 insertions, 0 deletions
diff --git a/package.json b/package.json index c3e21ce..916f69e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@types/react-dom": "17.0.0", "@types/react-router-dom": "5.1.7", "@types/react-transition-group": "4.4.0", + "@types/smoothscroll-polyfill": "0.3.1", "axios": "0.21.1", "copy-webpack-plugin": "7.0.0", "cross-env": "7.0.3", @@ -28,6 +29,7 @@ "react-router-dom": "5.2.0", "react-spinners": "0.10.4", "react-transition-group": "4.4.1", + "smoothscroll-polyfill": "0.4.4", "swc-loader": "0.1.12", "typescript": "4.1.3", "webpack": "5.11.1", diff --git a/src/components/ScrollToTop.tsx b/src/components/ScrollToTop.tsx index 4888dec..2c5e9ca 100644 --- a/src/components/ScrollToTop.tsx +++ b/src/components/ScrollToTop.tsx @@ -3,6 +3,9 @@ import { jsx, css } from "@emotion/react"; import React from "react"; import colors from "../colors"; +import smoothscroll from "smoothscroll-polyfill"; +smoothscroll.polyfill(); + const styles = css` width: 2.5rem; height: 2.5rem; @@ -2201,6 +2201,11 @@ dependencies: "@types/node" "*" +"@types/[email protected]": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@types/smoothscroll-polyfill/-/smoothscroll-polyfill-0.3.1.tgz#77fb3a6e116bdab4a5959122e3b8e201224dcd49" + integrity sha512-+KkHw4y+EyeCtVXET7woHUhIbfWFCflc0E0mZnSV+ZdjPQeHt/9KPEuT7gSW/kFQ8O3EG30PLO++YhChDt8+Ag== + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -8063,6 +8068,11 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" + version "0.4.4" + resolved "https://registry.yarnpkg.com/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz#3a259131dc6930e6ca80003e1cb03b603b69abf8" + integrity sha512-TK5ZA9U5RqCwMpfoMq/l1mrH0JAR7y7KRvOBx0n2869aLxch+gT9GhN3yUfjiw+d/DiF1mKo14+hd62JyMmoBg== + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" |