only blur activeElement if there is one - fixes #332

This commit is contained in:
Rich Harris
2018-08-01 21:34:30 -04:00
parent d1fcd07c92
commit 003fa8ab2c

View File

@@ -298,7 +298,7 @@ async function navigate(target: Target, id: number): Promise<any> {
await goto(redirect.location, { replaceState: true });
} else {
render(data, nullable_depth, scroll_history[id], token);
document.activeElement.blur();
if (document.activeElement) document.activeElement.blur();
}
}