Fixes ComboBox text and list if the height is equal to one. (#1606)

* Fixes ComboBox text and list if the height is equal to one. End and Home navigate on text.

* Trying fix the all scenarios unit test.

* Removing unnecessary code.

* Avoiding the Collection was modified after the enumerator was instantiated exception.

* Also cover the IndexOfValue inside the lock.

* Disposing the DrawContent event.

* Increasing the time to test.

* Revert "Increasing the time to test."

This reverts commit b3c2ac871c.

* CharacterMap take more time to load.
This commit is contained in:
BDisp
2022-02-20 21:39:22 +00:00
committed by GitHub
parent 0168a3c054
commit 1557f7a71e
9 changed files with 111 additions and 22 deletions

View File

@@ -159,10 +159,12 @@ namespace Terminal.Gui {
/// This method also returns <c>false</c> if the timeout is not found.
public bool RemoveTimeout (object token)
{
var idx = timeouts.IndexOfValue (token as Timeout);
if (idx == -1)
return false;
timeouts.RemoveAt (idx);
lock (timeouts) {
var idx = timeouts.IndexOfValue (token as Timeout);
if (idx == -1)
return false;
timeouts.RemoveAt (idx);
}
return true;
}
@@ -177,8 +179,11 @@ namespace Terminal.Gui {
if (k < now) {
if (timeout.Callback (this))
AddTimeout (timeout.Span, timeout);
} else
timeouts.Add (k, timeout);
} else {
lock (timeouts) {
timeouts.Add (k, timeout);
}
}
}
}