Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix search results initial scroll position
When search results are rendered, the result cursor is set to the first result and is scrolled into view via `scrollIntoView({block: "nearest"})`. Typically, this call to `scrollIntoView` would be a no-op. However, 6eb2e42 added a "TIP" at the top of the results container. Thus if the results container has `max-height: 0`, the `scrollIntoView` call will set the scroll position below the "TIP". Such is the case when clicking a `.query-button` or using the `?q=` URL param, because the `.active` class is not yet applied to the results container. This commit modifies the CSS so that the "TIP" is only shown when the `.active` class is applied. Thus the `scrollIntoView` call will remain a no-op even when the results container has `max-height: 0`.
- Loading branch information