Skip to content

Docs(autocomplete): regex filter search issue with character "?" and "$" #4440

Closed
@skyfremen

Description

@skyfremen

Bug, feature request, or proposal:

Documentation Bug on custom filtering : https://material.angular.io/components/component/autocomplete

What is the expected behavior?

Able to filter with character starting with ? and $

What is the current behavior?

Application crashes when filtering with character starting with ?
Not able to filter with character starting with $

What are the steps to reproduce?

Plunker Link
Search With > Result
S > Shelley
? > Application Crash
$ > No Result

What is the use-case or motivation for changing an existing behavior?

NA

Which versions of Angular, Material, OS, browsers are affected?

Angular 4.1.0
Material 2.0.0-beta.3
Chrome OS

Is there anything else we should know?

Came up with a solution to not use Regex. Plunker Link

filter(name: string): User[] {
     return this.options.filter((s) => s.name.toLowerCase().indexOf(name.toLowerCase()) !== -1);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions