Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Global search targeting substrings #396

Open
Benjathing opened this issue Nov 17, 2022 · 0 comments
Open

[Feat] Global search targeting substrings #396

Benjathing opened this issue Nov 17, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Benjathing
Copy link

Describe the Feature
Because Global Search is filters on any sub-string, it causes some unintended behaviour when a particular value is a sub-string of another value in the same column. In particular, searching "male" when "female" is also a valid value in a gender column.

Ideally, it would be possible to configure global search's starts-with vs contains behaviour, and additionally allow the use of meta-characters/wildcards so the user can specify the format of what they want to match on

To Reproduce

@page "/Bug152"

<Table TableItem="PersonData" Items="data" ShowSearchBar="true" ShowFooter="true">
    <Column TableItem="PersonData" Title="Gender" Field="@(x => x.Gender)" Sortable="false" Filterable="true" SetFooterValue="Count" />
</Table>

@code
{
    private PersonData[] data;

    protected override void OnInitialized()
    {
        data = new PersonData[]
        {
            new PersonData()
            {
                Gender = "Male"
            },
            new PersonData()
            {
                Gender = "Female"
            }
        };
    }

    public class PersonData
    {
        public string Gender { get; set; }
    }
}

Expected behavior
Searching "male" or "^male" would not return the Female result.

@Benjathing Benjathing added the enhancement New feature or request label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant