Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing Alt key on a Toplevel with only a MenuBar throws System.InvalidOperationException. #2810

Closed
BDisp opened this issue Aug 15, 2023 · 0 comments · Fixed by #2811
Closed
Labels

Comments

@BDisp
Copy link
Collaborator

BDisp commented Aug 15, 2023

Like #2776, running this unit test will fail on developer branch:

		[Fact, AutoInitShutdown]
		public void Activating_MenuBar_By_Alt_Key_Does_Not_Throw ()
		{
			var menu = new MenuBar (new MenuBarItem [] {
				new MenuBarItem ("Child", new MenuItem [] {
					new MenuItem ("_Create Child", "", null)
				})
			});
			var topChild = new Toplevel ();
			topChild.Add (menu);
			Application.Top.Add (topChild);
			Application.Begin (Application.Top);

			var exception = Record.Exception (() => topChild.ProcessHotKey (new KeyEvent (Key.AltMask, new KeyModifiers { Alt = true })));
			Assert.Null (exception);
		}

imagem

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Aug 15, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Aug 15, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Aug 15, 2023
…Bar throws System.InvalidOperationException.
@tig tig added the bug label Aug 18, 2023
@tig tig closed this as completed in #2811 Aug 30, 2023
tig added a commit that referenced this issue Aug 30, 2023
…ar-fix_2810

Fixes #2810. Pressing Alt key on a Toplevel with only a MenuBar throws System.InvalidOperationException.
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Aug 31, 2023
tig added a commit that referenced this issue Sep 29, 2023
…ar-fix_2810

Fixes #2810. Pressing Alt key on a Toplevel with only a MenuBar throws System.InvalidOperationException.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants