Skip to content

Commit

Permalink
Fix bug in object selection window where object list view was moved t…
Browse files Browse the repository at this point in the history
…o top when the search box was unselected
  • Loading branch information
Rampastring committed Jan 30, 2024
1 parent 19f4ca5 commit 0062414
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/TSMapEditor/UI/Windows/SelectObjectWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,20 @@ public override void Initialize()

private void TbSearch_TextChanged(object sender, EventArgs e)
{
lbObjectList.ViewTop = 0;

if (string.IsNullOrWhiteSpace(tbSearch.Text) || tbSearch.Text == tbSearch.Suggestion)
{
foreach (var item in lbObjectList.Items)
{
if (!item.Visible)
lbObjectList.ViewTop = 0;

item.Visible = true;
}
}
else
{
lbObjectList.ViewTop = 0;

lbObjectList.SelectedIndex = -1;

for (int i = 0; i < lbObjectList.Items.Count; i++)
Expand Down

0 comments on commit 0062414

Please sign in to comment.