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

Search results are obstructed when moving up through the list #1572

Open
golota60 opened this issue Sep 19, 2022 · 3 comments · May be fixed by #1573
Open

Search results are obstructed when moving up through the list #1572

golota60 opened this issue Sep 19, 2022 · 3 comments · May be fixed by #1573

Comments

@golota60
Copy link

golota60 commented Sep 19, 2022

Description

hey! thanks for this awesome library.
downstream issue: react-bootstrap/react-bootstrap#6437

The issue is pretty self-explanatory. When you move through the search results using arrow keys so that you scroll up, search results are obstructed by the sticky header.

It seems to me that it's happening cause the upstream autocomplete library is using scrollIntoView and scrollIntoViewIfNeeded which don't account for the sticky header. This has to be fixed upstream(by possibly allowing to pass an offset?). I've created this issue to track the fix here once upstream makes it possible to be fixed.

Steps to reproduce

  1. Go to https://docsearch.algolia.com/
  2. Click on the search button in the upper right corner.
  3. In the modal that is shown, input something so that the list gets populated with results
  4. Use arrow keys to navigate to the bottom of the modal
  5. Use arrow key up to go up through the list so that the list scrolls upwards
  6. The results that are being scrolled into view are not fully shown due to the sticky header

Live reproduction:

docsearch-bug.webm

Expected behavior

Elements should scroll underneath the sticky header so that they're visible

Environment

  • OS: Linux
  • Browser: Chrome 103
  • DocSearch version: 3.2.1
@golota60
Copy link
Author

golota60 commented Sep 19, 2022

Upstream discussion thread: algolia/autocomplete#1019

@sarahdayan
Copy link
Member

This seems to be a Chrome behavior, Firefox scrolls differently:

firefox.mov

Could the scroll-margin-top CSS property help here? That could be implemented in DocSearch (cc @shortcuts).

@golota60
Copy link
Author

Yeah, this prop seems to be fixing the issue - will create a PR shortly. Thanks!

@golota60 golota60 linked a pull request Sep 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants