algolia / algolia/autocomplete
Detached Mode History selection scrolls down to the bottom on iOS devices
- Dominant language
- TypeScript
- Stars
- 5.3k
- Forks
- 341
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 5
Description
## Description
_This one might be related to #591 because it tries to scroll into a miscalculated position? Not sure about that though._
By selecting a element from the History section on the detached panel _(createLocalStorageRecentSearchesPlugin)_ it will scroll to the bottom of the page on some iOS devices.
iOS 14.5.1 seems to be having this issue, older versions like 14.4 worked for some of my users, but it scrolled down for others.
It works perfectly on:
- Android devices
- Windows 10
- Safari desktop
**Note: it also works by selecting an autocomplete value which is NOT from the history. So only the History plugin bugs it somehow.**
## Reproduction
**Steps**
1. Go to [codesandbox](https://codesandbox.io/s/angry-haslett-kd7bg) on an iOS device
3. Open search input
4. select an item from History
https://user-images.githubusercontent.com/21248854/119544895-7920ce00-bd92-11eb-8b64-28a5c980adfa.mp4
_Video shows: starting: top of the screen, after clicking the history value, it jumps down to the bottom._
## Expected behavior
Keep the current state and don't scroll down.
## Environment
- OS: iOS 14.5.1 / multiple iOS devices
- Browser: Safari / Chrome
- Autocomplete version: 1.0.1
Update: new codesandbox for easier debugging
Contributor guide
Research direction
Reproduce the jump using the updated CodeSandbox on an affected iOS device, then trace the createLocalStorageRecentSearchesPlugin history-selection path. Compare it with autocomplete selection outside history and verify that selecting a history item preserves the current scroll position without affecting the listed working environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100