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

Docsearch safari bug: goes to end of page if modal is closed #1264

Open
jollydodo opened this issue Jul 30, 2024 · 1 comment
Open

Docsearch safari bug: goes to end of page if modal is closed #1264

jollydodo opened this issue Jul 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jollydodo
Copy link

jollydodo commented Jul 30, 2024

Description

if you open the docsearch modal and close it by pressing escape or outside the model, the browser will scroll to the end of the page very quickly. This is weird behaviour caused by the Algolia modal (only in Safari up till the current version). Multiple GitHub issues have been created about this since 2022, but there has been no fix by Algolia.

algolia/docsearch#1260

Steps to reproduce

See Above

Expected result

Nothing

Actual result

Scroll down

Environment

My own private environment, but you can reproduce it on getdoks.org.

Fix

It's kind of a buggy fix, but it works and everybody seems to use it. Even the creators of Bootstrap. https://getbootstrap.com/docs/5.3/getting-started/introduction/ (check source)

The solution is to simply add this to the end of your footer:

<div style="position: fixed; z-index: -1;">
   <input type="text">
</div>
@h-enk h-enk added the bug Something isn't working label Jul 31, 2024
@h-enk
Copy link
Member

h-enk commented Jul 31, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants