Skip to content

Commit

Permalink
Fix cursor visibility issue in mobile mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerrysmd committed Oct 15, 2023
1 parent 25aa0f5 commit f21f273
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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

0 comments on commit f21f273

Please sign in to comment.