algolia / algolia/docsearch

Results displays an incorrect title in Safari

Open
#1,477 6 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
4.4k
Forks
439
Avg merge
14h 32m
Merged PRs (30d)
19

Description

## Description

The displayed title of a `Results` section can be different for the same search result in Safari or Chrome/Firefox. We noticed this issue in our [iOS docs](https://img.ly/docs/pesdk/ios/getting-started/integration/swift-package-manager) for the search term `output`.

There are situations where the titles are consistent between both browsers but will become inconsistent once you continue to type your search term. I also noticed situations where titles were incorrect until Safari updated the UI and displayed the correct titles afterward.

Chrome:

![Screenshot 2022-08-02 at 14 29 50](https://user-images.githubusercontent.com/11522706/182375215-241fdb35-ab67-40cc-8d1d-5fb01e5aaee2.png)

Safari:

![Screenshot 2022-08-02 at 14 29 58](https://user-images.githubusercontent.com/11522706/182375234-d8543106-1d3c-4ca8-9979-a599ac972565.png)

This issue can also be reproduced if you search on other sites like https://docusaurus.io

Chrome:

![Screenshot 2022-08-02 at 14 13 00](https://user-images.githubusercontent.com/11522706/182373963-499d5239-9a21-4872-ac59-a47d2e0ea6d9.png)

Safari:
![Screenshot 2022-08-02 at 14 12 23](https://user-images.githubusercontent.com/11522706/182373987-285bb7e7-ef32-45bd-8e5b-8e63c6ca024a.png)

## Steps to reproduce

1. Go to https://docusaurus.io
2. Click on `Search`
3. Enter `out` in the Input

## Expected behavior

The titles should be:
- API
- Markdown Features
- Plugins
- Guides
- Migrating from v1 to v2

## Actual behavior

The titles are:
- API
- API
- Plugins
- Blog
- Plugins

## Environment

- OS: macOS
- Browser: Safari
- DocSearch version: `"@docsearch/react": "3.1.1"`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with @docsearch/react 3.1.1 in Safari and Chrome on docusaurus.io, searching for "out" and then continuing to type. Trace the Results section's title rendering and search-result updates; done means the expected titles remain consistent across both browsers while typing.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.