Explorar el Código

Fixes #1257 - ListView's ProcessKey should return false if no OpenSelectedItem handler is defined (#1258)

* tweaked version # for v1.0.0-beta.10

* tweaked version # for v1.0.0-beta.11

* Updated readme and revision history for 1.0

* adjusting publish workflow

* adjusting publish workflow2

* adjusting publish workflow 3

* adjusting publish workflow 4

* adjusting publish workflow 5

* final fix to yaml

* Updated relnotes for v1.0.0-rc.9

* rel notes for v1.0.0-rc.10

* ProcessKey now retruns false if no SelectedItem handler is defined
Charlie Kindel hace 4 años
padre
commit
26cb200737

+ 2 - 2
.github/workflows/publish.yml

@@ -26,7 +26,7 @@ jobs:
           echo "MINVERVERSIONOVERRIDE=$(minver -t v -d rc)" >> $GITHUB_ENV
 
       #- name: Install dependencies
-      #  run: dotnet restore
+      #   run: dotnet restore
 
       #- name: Build
       #  run: dotnet build --configuration Release --no-restore
@@ -74,7 +74,7 @@ jobs:
 
       - name: Test to generate Code Coverage Report
         run: |
-          dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage"  --settings UnitTests/coverlet.runsettings
+          dotnet test --verbosity normal --collect:"XPlat Code Coverage" --settings UnitTests/coverlet.runsettings
           mv -v UnitTests/TestResults/*/*.* UnitTests/TestResults/
 
       - name: Create Test Coverage Badge

+ 9 - 0
Terminal.Gui/Terminal.Gui.csproj

@@ -40,6 +40,15 @@
     <Title>Terminal.Gui is a framework for creating console user interfaces</Title>
 
     <PackageReleaseNotes>
+      v1.0.0-rc.10
+      * Fixes #931. Fixed the limit 25 lines issue
+      * Fixes #1251. Fixes TextValidateProvider exception on the All View Tester scenario.
+
+      v1.0.0-rc.9
+      * Fixes #1210. Added AllowsReturn, AllowsTab and Multiline into the TextView.
+      * Fixes #1241. Added SendKeys feature to the ConsoleDriver.
+      * Fixes #418 and #931. Unix terminal hangs after exit.
+
       v1.0.0-rc.2
       * Added TextValidateField - Enables masked and validated text input. Thanks @jmperricone!
       * Refactored TreeView and TabView to reduce api surface area

+ 8 - 4
Terminal.Gui/Views/ListView.cs

@@ -186,7 +186,8 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// If set to true allows more than one item to be selected. If false only allow one item selected.
 		/// </summary>
-		public bool AllowsMultipleSelection { get => allowsMultipleSelection;
+		public bool AllowsMultipleSelection {
+			get => allowsMultipleSelection;
 			set {
 				allowsMultipleSelection = value;
 				if (Source != null && !allowsMultipleSelection) {
@@ -392,8 +393,7 @@ namespace Terminal.Gui {
 					break;
 
 			case Key.Enter:
-				OnOpenSelectedItem ();
-				break;
+				return OnOpenSelectedItem ();
 
 			case Key.End:
 				return MoveEnd ();
@@ -650,8 +650,12 @@ namespace Terminal.Gui {
 		/// <returns></returns>
 		public virtual bool OnOpenSelectedItem ()
 		{
-			if (source.Count <= selected || selected < 0) return false;
+			if (source.Count <= selected || selected < 0 || OpenSelectedItem == null) {
+				return false;
+			}
+
 			var value = source.ToList () [selected];
+
 			OpenSelectedItem?.Invoke (new ListViewItemEventArgs (selected, value));
 
 			return true;