sign_up: fix suggestions error when navigating away
When navigating away from the page, the field receives the 'focusout' event – but stops to be present in the DOM. Thus we need to check that the DOM element is actually present.
This commit is contained in:
parent
fccbbdf53a
commit
a5f2c84cbf
2 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ delegate('focusout', userNewEmailSelector, () => {
|
|||
const suggestedEmailSpan = document.querySelector(emailSuggestionSelector);
|
||||
|
||||
const suggestion = suggest(userEmailInput.value);
|
||||
if (suggestion && suggestion.full) {
|
||||
if (suggestion && suggestion.full && suggestedEmailSpan) {
|
||||
suggestedEmailSpan.innerHTML = suggestion.full;
|
||||
show(document.querySelector(suggestionsSelector));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue