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
Description
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.