-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Close command palette on focus loss #8355
Comments
My opinion: we should definitely do (1). It’s an ephemeral UI, users should not expect that it will hang around forever. @zadjii-msft what does Sublime do? |
I am checking how to do it hypothetically (less trivial than I thought, as dismissing the palette auto focuses the tab content, eventually dismissing menus, etc.).. so if @zadjii-msft likes this approach I will probably have some draft.. |
@zadjii-msft - if you like the idea I have the code.. but it is probably the worst one I wrote since I was 10: there are several small nuances that I had to handle each one of them.. probably there is some better solution, but I am still not in enough to see it. |
Added the PR Draft so it won't get lost. |
(I want to get back to this before the EOD but I'm also worried I might not, and I'm about to start a 6 day vacation. Just wanted to give a heads up) |
Thanks for the heads up and enjoy your vacation! |
So the implementation is somewhat dirty. The ideas was nice - add lostFocusHandler However it broke few things: * In the TabSwitcher the ListItem must be focusable since otherwise the SingleSelectionMode behavior breaks. To address this I had to put the lostFocusHandler on the items as well * When you click the flyout, the palette loses focus, which makes the terminal page to set the focus on the tab, closing the flyout. To address this I had to ensure the tab won't get focused once the flyout is open. In addition, flyout should fix the focus before opening, otherwise alt+tab will put a focus on a tab row rather than on tab * I also had to close the palette if the tab order changes. To prevent inconsistencies. Closes #8355
🎉This issue was addressed in #8377, which has now been successfully released as Handy links: |
So the implementation is somewhat dirty. The ideas was nice - add lostFocusHandler However it broke few things: * In the TabSwitcher the ListItem must be focusable since otherwise the SingleSelectionMode behavior breaks. To address this I had to put the lostFocusHandler on the items as well * When you click the flyout, the palette loses focus, which makes the terminal page to set the focus on the tab, closing the flyout. To address this I had to ensure the tab won't get focused once the flyout is open. In addition, flyout should fix the focus before opening, otherwise alt+tab will put a focus on a tab row rather than on tab * I also had to close the palette if the tab order changes. To prevent inconsistencies. Closes microsoft#8355
Description of the new feature/enhancement
Currently we dismiss command palette programmatically if user clicks in the bounds of "Tab Content" (second grid row of the terminal page), however if the click is performed outside of these boundaries (e.g., outside of the terminal window or in the tab row) we do not dismiss the palette.
And this is problematic for many reasons.
Here is the simplest example - opening a tab while palette is open leaves it open an without a focus (meaning it can be closed only with mouse):
Same can be achieved by clicking on menu, and then click outside of it (but now you cannot even type)
Same of course happens for the tab switcher
This might might be a root cause for #8319.
The idea here is to close the palette upon focus loss.
There are two approaches to it:
The text was updated successfully, but these errors were encountered: