add explanation why we check for document.activeElement first