Skip to content

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

Open
@jollydodo

Description

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions