Commit b6956164 authored by Sam Gluck's avatar Sam Gluck
Browse files

Do not attempt scroll without element;

parent b9450a9e
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
"precommit": "lint-staged", "precommit": "lint-staged",
"test": "node scripts/test.js --env=jsdom", "test": "node scripts/test.js --env=jsdom",
"styleguide": "styleguidist server", "styleguide": "styleguidist server",
"styleguide:build": "styleguidist build" "styleguide:build": "styleguidist build",
"ol:start:app": "sudo PORT=3002 ./node_modules/forever/bin/forever -c \"npm run start\" ./",
"ol:start:styleguide": "sudo ./node_modules/forever/bin/forever -c \"npm run styleguide\" ./"
}, },
"lint-staged": { "lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,md}": [ "src/**/*.{js,jsx,ts,tsx,json,css,md}": [
......
...@@ -314,6 +314,9 @@ export default class SignUp extends React.Component<SignUpProps, SignUpState> { ...@@ -314,6 +314,9 @@ export default class SignUp extends React.Component<SignUpProps, SignUpState> {
scrollForStep(step) { scrollForStep(step) {
// https://gist.github.com/andjosh/6764939#gistcomment-2047675 // https://gist.github.com/andjosh/6764939#gistcomment-2047675
function scrollTo(element, to = 0, duration = 1000) { function scrollTo(element, to = 0, duration = 1000) {
if (!element) {
return;
}
const start = element.scrollTop; const start = element.scrollTop;
const change = to - start; const change = to - start;
const increment = 20; const increment = 20;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment