Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the issue 412 ->Focus to glyphicon-search with necessary delay #455

Merged
merged 1 commit into from
Mar 6, 2025
Merged
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
16 changes: 16 additions & 0 deletions theme/apache/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@
</div>
</nav>
</header>
<!-- Script is to make the input field ready as soon as user click the search button-->
<!-- script could be simplyfy and shorten in length bootstrap framework -->
<script>
document.addEventListener('DOMContentLoaded', function () {
// Using Bootstrap's event system for dropdowns
$(document).on('shown.bs.dropdown', '.dropdown', function () {
// Check if this is the search dropdown
if ($(this).find('.glyphicon-search').length > 0) {
// Find and focus the search input
setTimeout(function() {
$('.pagefind-ui__search-input').focus();
}, 50); // Small delay to ensure input is ready
}
});
});
</script>
<!-- / Navigation -->
<header id="main-header" class="container">
<div class="sideImg">
Expand Down