Skip to content

Commit

Permalink
Fix cursor visibility issue in mobile mode (#1087)
Browse files Browse the repository at this point in the history
* Resolve new cursor missing issue caused by previous 'Fix cursor missing issue' PR

* Fix cursor visibility issue in mobile mode
  • Loading branch information
Jerrysmd authored Oct 23, 2023
1 parent 3e7a329 commit 9dc3905
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,18 @@ function initSearch () {
window._searchMobileOnce = true
// Turn on the mask when clicking on the search button
searchInput.addEventListener('focus', () => {
loadScript('autocomplete-script', '/lib/autocomplete/autocomplete.min.js', () => initAutosearch())
loadScript('autocomplete-script', '/lib/autocomplete/autocomplete.min.js', () => {
initAutosearch();
searchInput.focus();
})
if (window.config?.search?.type === 'algolia') {
loadScript('algolia-script', '/lib/algoliasearch/algoliasearch-lite.umd.min.js', null)
} else {
loadScript('fuse-script', '/lib/fuse/fuse.min.js', null)
}
document.body.classList.add('blur')
header.classList.add('open')
searchInput.focus()
})
// Turn off the everything when clicking on the cancel button
document.getElementById('search-cancel-mobile').addEventListener('click', () => {
Expand Down Expand Up @@ -236,6 +240,7 @@ function initSearch () {
}
document.body.classList.add('blur')
header.classList.add('open')
searchInput.focus()
})
// Clear the search box when clicking on the clear button
searchClear.addEventListener('click', () => {
Expand Down

1 comment on commit 9dc3905

@vercel
Copy link

@vercel vercel bot commented on 9dc3905 Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.