Skip to content

Commit

Permalink
Fix mozilla#1108 Hide email input on signup page so that it doesn't h…
Browse files Browse the repository at this point in the history
…ide par… (mozilla#1140)

* Fix mozilla#1108 Hide email input on signup page so that it doesn't hide part of the bottom of the page

* Fix mozilla#1115 Prevent clicking on the button more than once in a row.

* Show the email input on desktop
  • Loading branch information
fzzzy authored and dannycoates committed Feb 8, 2019
1 parent 41eaa66 commit 16224b3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/ui/signupDialog.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* global LIMITS */
const html = require('choo/html');
const { bytes } = require('../utils');
const { bytes, platform } = require('../utils');

module.exports = function() {
return function(state, emit, close) {
setTimeout(function() {
document.getElementById('email-input').focus();
});
const hidden = platform() === 'android' ? 'hidden' : '';
let submitting = false;
return html`
<send-signup-dialog class="flex flex-col p-4">
<p class="p-8">
Expand All @@ -25,12 +24,12 @@ module.exports = function() {
<input
id="email-input"
type="text"
class="border rounded w-full px-2 py-1 h-12 mb-4 text-lg text-grey-darker leading-loose"
placeholder=${state.translate('emailEntryPlaceholder')}/>
class="${hidden} border rounded w-full px-2 py-1 h-12 mb-4 text-lg text-grey-darker leading-loose"
placeholder=${state.translate('emailEntryPlaceholder')} />
<input
class="hidden"
id="email-submit"
type="submit"/>
type="submit" />
</form>
<label class="btn rounded w-full flex flex-no-shrink items-center justify-center" for="email-submit">
${state.translate('signInMenuOption')}
Expand All @@ -53,6 +52,11 @@ module.exports = function() {

function submitEmail(event) {
event.preventDefault();
if (submitting) {
return;
}
submitting = true;

const el = document.getElementById('email-input');
const email = el.value;
emit('login', emailish(email) ? email : null);
Expand Down

0 comments on commit 16224b3

Please sign in to comment.