Skip to content

Synchronous InlineAutocomplete suggestions don't work when there isn't any text after the trigger character #2813

@iansan5653

Description

@iansan5653

This is a really specific one that took a bit of time to track down:

Emoji suggestions are broken in the Markdown editor in Projects and Hyperlist when there is no text after the trigger character. For example, if you focus a Markdown editor in Projects and just type :, the suggestions list appears but the suggestions are not selectable.

This isn't a major issue because 99% of the time, you aren't going to type : and try to select an emoji - you are going to filter the emojis list down to get the one you want.

This appears to be due to some race condition in the InlineAutocomplete component. It only seems to happen when the suggestions are synchronous: reference and mention suggestions don't do this because they are loaded asynchronously. It seems to be that the useCombobox hook is not engaging correctly and this is causing the keyboard shortcuts and interaction hooks to not be initiated properly.

The bug is not reproducible in the Gatsby docs (strangely) but it is reproducible in Hyperlist, Projects, and the Primer React Storybook.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreact

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions