Parcourir la source

Ensures the event SelectedChanged gets fired if the lastSelectedItem == -1.

BDisp il y a 5 ans
Parent
commit
8582017b13
1 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. 11 0
      Terminal.Gui/Views/ListView.cs

+ 11 - 0
Terminal.Gui/Views/ListView.cs

@@ -529,6 +529,17 @@ namespace Terminal.Gui {
 			return true;
 		}
 
+		///<inheritdoc/>
+		public override bool OnEnter (View view)
+		{
+			if (lastSelectedItem == -1) {
+				OnSelectedChanged ();
+				return true;
+			}
+
+			return false;
+		}
+
 		///<inheritdoc/>
 		public override void PositionCursor ()
 		{