Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Add guard for document.activeElement.blur error #578

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fastclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
var clickEvent, touch;

// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
if (document.activeElement && document.activeElement !== targetElement) {
if (document.activeElement && document.activeElement.blur && document.activeElement !== targetElement) {
document.activeElement.blur();
}

Expand Down