'React autocomplete with discontinuous text

I'm looking for a way to create a React input with nice autocomplete options, such that the suggestions will render even if the text to match is split.
What I mean by that is that if the options are ["Apple", "Banana", "Orange", "Mango"] for example and the input value is "ae", both Apple and Orange will be suggested.

A good exmaple for what I'm searching for is the vscode autocomplete:

an example

I'm using React with TypeScript if it matters.

Thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source