Browse Source

Fixed CanFocus not being true by default for TableView

tznind 4 years ago
parent
commit
74d4d1b895
2 changed files with 2 additions and 3 deletions
  1. 2 1
      Terminal.Gui/Views/TableView.cs
  2. 0 2
      UICatalog/Scenarios/TableEditor.cs

+ 2 - 1
Terminal.Gui/Views/TableView.cs

@@ -79,7 +79,7 @@ namespace Terminal.Gui.Views {
 		/// Initialzies a <see cref="TableView"/> class using <see cref="LayoutStyle.Computed"/> layout. 
 		/// Initialzies a <see cref="TableView"/> class using <see cref="LayoutStyle.Computed"/> layout. 
 		/// </summary>
 		/// </summary>
 		/// <param name="table">The table to display in the control</param>
 		/// <param name="table">The table to display in the control</param>
-		public TableView (DataTable table) : base ()
+		public TableView (DataTable table) : this ()
 		{
 		{
 			this.Table = table;
 			this.Table = table;
 		}
 		}
@@ -89,6 +89,7 @@ namespace Terminal.Gui.Views {
 		/// </summary>
 		/// </summary>
 		public TableView () : base ()
 		public TableView () : base ()
 		{
 		{
+			CanFocus = true;
 		}
 		}
 
 
 		///<inheritdoc/>
 		///<inheritdoc/>

+ 0 - 2
UICatalog/Scenarios/TableEditor.cs

@@ -48,8 +48,6 @@ namespace UICatalog.Scenarios {
 				Width = Dim.Fill (),
 				Width = Dim.Fill (),
 				Height = Dim.Fill (),
 				Height = Dim.Fill (),
 			};
 			};
-			tableView.CanFocus = true;
-
 
 
 			Win.Add (tableView);
 			Win.Add (tableView);
 		}
 		}