mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:35:05 +08:00
Use OnCommit instead of OnChange simplifies things
This commit is contained in:
parent
f740707712
commit
b1a55f6b5e
@ -51,7 +51,11 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
};
|
||||
|
||||
searchTextBox.OnChange += (sender, text) => FilterChanged?.Invoke();
|
||||
searchTextBox.OnCommit += (sender, newText) =>
|
||||
{
|
||||
if (newText)
|
||||
FilterChanged?.Invoke();
|
||||
};
|
||||
searchTextBox.Exit = () => Exit?.Invoke();
|
||||
}
|
||||
|
||||
|
@ -189,13 +189,9 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
private ScheduledDelegate filterTask;
|
||||
private string previousFilter = string.Empty;
|
||||
|
||||
private void filterChanged()
|
||||
{
|
||||
if (previousFilter == filter.Search)
|
||||
return;
|
||||
previousFilter = filter.Search;
|
||||
filterTask?.Cancel();
|
||||
filterTask = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user