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

searchViewletFocus gets set true on launch if the viewlet is open, even if it is not focused #88803

Closed
JacksonKearl opened this issue Jan 16, 2020 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Milestone

Comments

@JacksonKearl
Copy link
Contributor

To rest to false, you must focus then blur the viewlet. In particular, this means that if you reload the window with the viewlet open, triggering the keybinding for toggle regex will toggle the global search regex instead of the find in files regex (assuming they're the same bind), until you explicitly focus and de-focus the viewlet.

@vscodebot vscodebot bot added the search Search widget and operation issues label Jan 16, 2020
@JacksonKearl
Copy link
Contributor Author

JacksonKearl commented Jan 16, 2020

@roblourens any ideas on why this would happen?
added
image
here https://github.com/microsoft/vscode/blob/master/src/vs/workbench/contrib/search/browser/searchView.ts#L355
and see that the focus callback gets called immediately on launch, even if its not focused.

@roblourens
Copy link
Member

roblourens commented Jan 16, 2020

That is onDidFocus on the ViewPane, @sbatten ?

@JacksonKearl
Copy link
Contributor Author

JacksonKearl commented Jan 16, 2020

Element gets focused on creation here

But it seems that it doesn't later get blured, even if focus moves elsewhere

@sbatten
Copy link
Member

sbatten commented Jan 16, 2020

@sandy081 i don't think this was introduced in the refactor, is there a reason this should focus on create?

@sandy081
Copy link
Member

I do not see a reason, I also think it is not correct to focus on create.

@roblourens roblourens assigned sandy081 and unassigned roblourens Jan 17, 2020
@sandy081 sandy081 added this to the January 2020 milestone Jan 21, 2020
@alexdima
Copy link
Member

I also hit this and it blocked me from committing in the Git Viewlet because cmd+enter was eaten by:

{ "key": "cmd+enter",             "command": "search.action.openInEditor",
                                     "when": "hasSearchResult && previewSearchEditor && previewSearchEditor && searchViewletFocus" },

@JacksonKearl JacksonKearl added the bug Issue identified by VS Code Team member as probable bug label Jan 27, 2020
@RMacfarlane RMacfarlane added the verified Verification succeeded label Jan 31, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants