Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Alternately displays dropdown #32

Open
RishikeshVedpathak opened this issue Oct 21, 2016 · 1 comment
Open

Alternately displays dropdown #32

RishikeshVedpathak opened this issue Oct 21, 2016 · 1 comment

Comments

@RishikeshVedpathak
Copy link

While mentioning it displays dropdown for alternate characters. Refer attached image.

smartarea-issue

@RishikeshVedpathak
Copy link
Author

The possible solution which I found is to add below line of code inside triggerDropdownAdvanced finction,

element.trigger.exec(searchable);

see below code snippet

else if(typeof(element.trigger) === 'object'){
// I need to get the index of the last match
var searchable = text.substr(0, position),
match, found = false, lastPosition = 0;
while ((match = element.trigger.exec(searchable)) !== null){
if(match.index === lastPosition){
break;
}
lastPosition = match.index;
if(match.index + match[0].length === position){
found = true;
element.trigger.exec(searchable);
break;
}
}
if(found){
element.list(match, function(data){
$scope.dropdown.content = data.map(function(el){
el.display = $sce.trustAsHtml(el.display);
return el;
});
$scope.dropdown.customSelect = element.onSelect;
$scope.dropdown.mode = element.mode || 'append';
$scope.dropdown.match = match[1];
$scope.dropdown.showFilter = element.filter || false;
});
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant