Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-autocomplete + md-min-length="0" + required fails (throws exception) #5162

Closed
@bvilches

Description

@bvilches

Open the md-autocomplete demo in Code Pen and add the required property to it.

Now select one state and start backspacing the content. When you delete the final letter you will get an exception: "Cannot read property 'toLowerCase' of undefined".

This is happening at line 17857 in the handleQuery function:

function handleQuery () {
    var searchText = $scope.searchText,
    term       = searchText.toLowerCase();
}

Somehow, the $scope.searchText is undefined instead of being an empty string. The weird thing is that this only happens when the md-autocomplete is required.

Of course you will only see it if md-min-length is 0.

Metadata

Metadata

Assignees

Labels

pr: merge readyThis PR is ready for a caretaker to review

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions