diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs
index 4cd600f3f..a4a608093 100644
--- a/Terminal.Gui/Views/Button.cs
+++ b/Terminal.Gui/Views/Button.cs
@@ -256,7 +256,7 @@ namespace Terminal.Gui {
///
public override void PositionCursor ()
{
- if (HotKey == Key.Unknown) {
+ if (HotKey == Key.Unknown && text != "") {
for (int i = 0; i < base.Text.RuneCount; i++) {
if (base.Text [i] == text [0]) {
Move (i, 0);
diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs
index edda3950b..8a2d430a8 100644
--- a/Terminal.Gui/Views/ComboBox.cs
+++ b/Terminal.Gui/Views/ComboBox.cs
@@ -238,7 +238,7 @@ namespace Terminal.Gui {
search.CursorPosition = search.Text.RuneCount;
- return true;
+ return base.OnEnter (view);
}
///
@@ -251,7 +251,7 @@ namespace Terminal.Gui {
listview.TabStop = false;
}
- return true;
+ return base.OnLeave (view);
}
///
diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs
index fad92f4e2..b988cfb9d 100644
--- a/Terminal.Gui/Views/ListView.cs
+++ b/Terminal.Gui/Views/ListView.cs
@@ -673,7 +673,6 @@ namespace Terminal.Gui {
if (lastSelectedItem == -1) {
EnsuresVisibilitySelectedItem ();
OnSelectedChanged ();
- return true;
}
return base.OnEnter (view);
@@ -684,10 +683,9 @@ namespace Terminal.Gui {
{
if (lastSelectedItem > -1) {
lastSelectedItem = -1;
- return true;
}
- return false;
+ return base.OnLeave (view);
}
void EnsuresVisibilitySelectedItem ()
diff --git a/Terminal.Gui/Views/TabView.cs b/Terminal.Gui/Views/TabView.cs
index 193751e4c..2b925d010 100644
--- a/Terminal.Gui/Views/TabView.cs
+++ b/Terminal.Gui/Views/TabView.cs
@@ -174,7 +174,7 @@ namespace Terminal.Gui {
int startAtY = Math.Max (0, GetTabHeight (true) - 1);
DrawFrame (new Rect (0, startAtY, bounds.Width,
- bounds.Height - spaceAtBottom - startAtY), 0, true);
+ Math.Max (bounds.Height - spaceAtBottom - startAtY, 0)), 0, true);
}
if (Tabs.Any ()) {
diff --git a/Terminal.Gui/Views/TextValidateField.cs b/Terminal.Gui/Views/TextValidateField.cs
index 940480b57..2c5314979 100644
--- a/Terminal.Gui/Views/TextValidateField.cs
+++ b/Terminal.Gui/Views/TextValidateField.cs
@@ -454,7 +454,7 @@ namespace Terminal.Gui {
// Fixed = true, is for inputs thar have fixed width, like masked ones.
// Fixed = false, is for normal input.
// When it's right-aligned and it's a normal input, the cursor behaves differently.
- if (provider.Fixed == false && TextAlignment == TextAlignment.Right) {
+ if (provider?.Fixed == false && TextAlignment == TextAlignment.Right) {
Move (cursorPosition + left - 1, 0);
} else {
Move (cursorPosition + left, 0);
@@ -591,7 +591,7 @@ namespace Terminal.Gui {
public override bool ProcessKey (KeyEvent kb)
{
if (provider == null) {
- return true;
+ return false;
}
switch (kb.Key) {
diff --git a/UnitTests/AllViewsTests.cs b/UnitTests/AllViewsTests.cs
index 913090e7a..5b62591f7 100644
--- a/UnitTests/AllViewsTests.cs
+++ b/UnitTests/AllViewsTests.cs
@@ -22,53 +22,67 @@ namespace Terminal.Gui.Views {
public bool Constructors_FullTest (Type type)
{
foreach (var ctor in type.GetConstructors ()) {
- if (type.IsGenericType && type.IsTypeDefinition) {
- List gTypes = new List ();
-
- foreach (var args in type.GetGenericArguments ()) {
- gTypes.Add (typeof (object));
- }
- type = type.MakeGenericType (gTypes.ToArray ());
-
- Assert.IsType (type, (View)Activator.CreateInstance (type));
-
- } else {
- ParameterInfo [] paramsInfo = ctor.GetParameters ();
- Type paramType;
- List