Comment

Eddie

Hmm, maybe we are looking at different demos? The demo you linked in this blog post (https://codesandbox.io/s/62x4mmxr0n) should return 20 results when you type in "django" but only returns 18. The word "django" is in two of the first two titles.

Parent comment

Peter Bengtsson

I'm not surprised it's buggy :) But what do you mean by searching for "django." in the demo? There's nothing to match for that string in all the titles.

Replies

Paul

I think the bug is that it's using the "global" flag which is stateful. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test
Change flags to "i" and it behaves as expected.