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

'CUT' not work in context menu #10571

Closed
shuyaqian opened this issue Dec 22, 2021 · 3 comments · Fixed by #10626
Closed

'CUT' not work in context menu #10571

shuyaqian opened this issue Dec 22, 2021 · 3 comments · Fixed by #10626
Assignees
Labels
bug bugs found in the application menus issues related to the menu

Comments

@shuyaqian
Copy link
Contributor

Bug Description:

Steps to Reproduce:

  1. select something
  2. click Edit—>Cut
  3. cut not work

Additional Information

  • Operating System: linux
  • Theia Version: 1.19.0
@msujew
Copy link
Member

msujew commented Dec 22, 2021

@shuyaqian I am not able to reproduce this issue on the current master. Do you mind retesting it there?

@colin-grant-work colin-grant-work added bug bugs found in the application 🤔 needs more info issues that require more info from the author menus issues related to the menu labels Dec 22, 2021
@colin-grant-work
Copy link
Contributor

colin-grant-work commented Dec 22, 2021

I believe it's a similar issue to #10540. Basically, it goes back to #9830: that PR introduced conditions under which what was formerly not a context menu got to be rendered as a context menu. That means that commands that formerly didn't receive the default Anchor argument associated with context menus are now receiving it, and since command handlers receive any[] as their args and so can assert that they'll receive what they want without checking, very few commands have effective type checking.

There are a few options:

I think the last is actually the correct move: it isn't really a context menu, and it shouldn't behave like one. That would fix all affected handlers without our having to identify them one by one. I think the utilities in browser-menu-plugin.ts can be of use here, but it will take a bit of fiddling.

@colin-grant-work
Copy link
Contributor

With a bit of checking, this turns out not to have to do with the context menu anchor issue at all, but with a failure of the menu-opening machinery of the new compact menu widget to restore focus to the previous context when the user makes a selection. Then, since the context is not the text input, the cut command has no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application menus issues related to the menu
Projects
None yet
3 participants