algolia / algolia/autocomplete

Keyboard nav in Safari breaks search input field

Open
#985 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
341
Avg merge
3d 1h
Merged PRs (30d)
5

Description

## Description

In Safari 15.3, using keyboard navigation inside the search field moves the cursor to an unexpected place when typing. The attached video shows it in action on the Algolia docs site, but it's also reproducible on my own site.

https://www.algolia.com/doc/ui-libraries/autocomplete/introduction/what-is-autocomplete/

## Reproduction

On Safari 15.3 (works ok in Safari 15.5 as well as current Chrome/Firefox):

**Steps**

1. Type in a search term.
2. Use either the mouse or keyboard to put the cursor somewhere inside the entered text (not at the end).
3. Start typing new characters.
4. Only the first letter you type is added at the cursor location, before the cursor jumps back to the end of the previously typed text automatically.

## Expected behavior

Any text entered should appear at the cursor's position, even if it's inside existing text. Safari 15.3 isn't that old. :(

## Environment

- OS: Mac
- Browser: Safari 15.3
- Autocomplete version: v1.6.3

https://user-images.githubusercontent.com/6754378/172673290-d46b66c0-5db2-404d-b2a7-3b144b1d55e7.mov

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.