diff --git a/src/common/Checkbox/styles.less b/src/common/Checkbox/styles.less index 10986c425..ffe321f53 100644 --- a/src/common/Checkbox/styles.less +++ b/src/common/Checkbox/styles.less @@ -16,8 +16,8 @@ opacity: 0; height: 0; width: 0; - top: -99999999px; - left: -99999999px; + top: 0; + left: 0; } &:global(.checked) { diff --git a/src/routes/Intro/Intro.js b/src/routes/Intro/Intro.js index ea94e84d4..8bbce9e13 100644 --- a/src/routes/Intro/Intro.js +++ b/src/routes/Intro/Intro.js @@ -18,6 +18,7 @@ class Intro extends Component { this.termsRef = React.createRef(); this.privacyPolicyRef = React.createRef(); this.marketingRef = React.createRef(); + this.errorRef = React.createRef(); this.state = { selectedForm: FORMS.SIGN_UP, @@ -32,6 +33,7 @@ class Intro extends Component { } changeSelectedForm = (event) => { + event.currentTarget.blur(); this.setState({ selectedForm: event.currentTarget.dataset.option, termsAccepted: false, @@ -85,6 +87,12 @@ class Intro extends Component { nextState.error !== this.state.error; } + componentDidUpdate(prevProps, prevState) { + if (prevState.error !== this.state.error && this.state.error.length > 0) { + this.errorRef.current.scrollIntoView(); + } + } + loginOnSubmit = (event) => { event.preventDefault(); if (this.state.email.length < 8) { @@ -144,7 +152,7 @@ class Intro extends Component { } } - validateGuestLogin = (event) => { + guestLoginOnSubmit = (event) => { if (!this.state.termsAccepted) { event.preventDefault(); this.setState({ error: 'You must accept the Terms of Service' }); @@ -154,15 +162,15 @@ class Intro extends Component { renderSignUpForm = () => { return (