problem with Combo : when typing digits
Closed this issue · 2 comments
alipishkari commented
Please fill out either the bug or feature request section and remove whatever section you are not using.
Bug
Hey,
when I type some digits on combo box there is no suggestion panel.
I have a complex type object. it has an ID and also text
when a user types a text I find my records and it's ok
but when user type digit, I can find my records too. but suggestion panel does not appear
- Version Number of Control:
- Device Tested On:
- Simulator Tested On:
Affects
- iOS
- Android
Expected Behavior
Actual Behavior
Steps to reproduce the Behavior
Link to Github Reproduction (optional but recommended)
Feature Request:
Please fill in what you would like
alipishkari commented
this is my code :
`
private static void AgencyPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
var model = (CheckListHeaderViewModel)bindable;
var text = newValue.ToString();
if (string.IsNullOrEmpty(text)) return;
model.Agencies.Clear();
List<Model.Agency> agencs;
long dig = 0;
if (! long.TryParse(text,out dig))
{
agencs= StaticAgencies.Where(a => a.Name.Contains(text)).ToList();
}
else
{
agencs = StaticAgencies.Where(a => a.Code.Contains(text)).ToList();
}
int max = 5;
if (agencs.Count < 5)
{
max = agencs.Count;
}
for (int i = 0; i < max; i++)
{
Model.Agency agencyitem = agencs[i];
string itm = agencyitem.ToString();
model.Agencies.Add($"{itm}");
}
}`
alipishkari commented
I updated sort function and it's ok know