Skip to content

Wrong results of highlighting #792

@pbelzek-cq

Description

@pbelzek-cq

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

I've observed that Fuse.js highlights substrings of searched keywords. It doesn't make any sense to do so because it leads to false positives and highlights that provide no value for the user.

You can find a sandbox here: https://codesandbox.io/p/sandbox/wc7pl4

(I'm on 7.0.0 version - there is no 7.0.0 option in the select menu in issue creator, you should add it)

The Fuse.js version where this bug is happening.

Other (please specify in description)

Is this a regression?

  • This is a regression bug

Which version did this behavior use to work in?

None

Steps To Reproduce

  1. In the input field type in olympics
    In matches array, most of the selected indices refer to substrings of the search keyword.For example, it highlights sets of two letters like ic in the word office because ic also exists in the word olympics.

Expected behavior

It should highlight provided keywords as a whole, not a substrings of them. When searching for olympics it should only highlight the word olympics, not ic in the word office.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions