Fixed combobox

This commit is contained in:
Tig
2024-10-06 16:36:04 -06:00
parent f2d27a5d08
commit f5f850bb93
3 changed files with 28 additions and 23 deletions

View File

@@ -817,7 +817,6 @@ Three ",
{
ObservableCollection<string> source = ["One", "Two", "Three"];
var cb = new ComboBox { Width = 10 };
cb.SetSource (source);
var top = new Toplevel ();
top.Add (cb);
@@ -826,6 +825,8 @@ Three ",
top.Add (otherView);
Application.Begin (top);
cb.SetSource (source);
Assert.True (cb.HasFocus);
Assert.Equal (-1, cb.SelectedItem);
Assert.Equal (string.Empty, cb.Text);
@@ -833,7 +834,7 @@ Three ",
cb.OpenSelectedItem += (s, _) => opened = true;
Assert.True (Application.OnKeyDown (Key.Enter));
Assert.False (Application.OnKeyDown (Key.Enter));
Assert.False (opened);
cb.Text = "Tw";