Skip to content

Fix: selecting entry should focus back to editor - #114493

Merged
Benjamin Pasero (bpasero) merged 5 commits into
microsoft:masterfrom
susiwen8:106824
Jan 19, 2021
Merged

Benjamin Pasero (bpasero) merged 5 commits into
microsoft:masterfrom
susiwen8:106824

Conversation

@susiwen8

@susiwen8 susiwen8 (susiwen8) commented Jan 17, 2021 •

Copy link
Copy Markdown
Contributor

This PR fixes #106824

If active editor wasn't focused after selection, then manually focus editor.

@chrmarti

Copy link
Copy Markdown
Collaborator

Would it make sense to move this to ChangeModeAction? That way we know it is only triggered when the user went through the picker UI.

@susiwen8

Copy link
Copy Markdown
Contributor Author

Would it make sense to move this to ChangeModeAction? That way we know it is only triggered when the user went through the picker UI.

Yes, It makes more sense.

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are more pickers for which this issue exists (e.g. changing encoding), I wonder if this should be added to all for consistency?

@bpasero Benjamin Pasero (bpasero) added this to the On Deck milestone Jan 18, 2021
@susiwen8

Copy link
Copy Markdown
Contributor Author

Since there are more pickers for which this issue exists (e.g. changing encoding), I wonder if this should be added to all for consistency?

Benjamin Pasero (@bpasero) Sure.

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected the code to focus the active editor after each individual picker, not in that place. Maybe I am missing something? Shouldn't the focus happen after the user picked something from quick pick?

@susiwen8

susiwen8 (susiwen8) commented Jan 18, 2021 •

Copy link
Copy Markdown
Contributor Author

I would have expected the code to focus the active editor after each individual picker, not in that place. Maybe I am missing something? Shouldn't the focus happen after the user picked something from quick pick?

Benjamin Pasero (@bpasero) Yes, that's right, after user pick something from quick pick, active editor should been focused. But somehow, for some quick pick, selecting by mouse click or enter is kind of different.

For mouse click, document.activeElement become editor after selection, but status bar for enter(some cases). That's why I decided to manually focus editor after each select if editor weren't focused.

doRenderNow is the 'converge' function where all post selection action would cross. So I have put logic here.

Kapture.2021-01-18.at.22.42.00.mp4

@bpasero

Copy link
Copy Markdown
Contributor

susiwen8 (@susiwen8) that is the thing I question

doRenderNow is the 'converge' function where all post selection action would cross. So I have put logic here.

No, it is the function called whenever a label changes in the editor status bar, not when picking something.

@bpasero
Benjamin Pasero (bpasero) merged commit 2472798 into microsoft:master Jan 19, 2021
@bpasero

Copy link
Copy Markdown
Contributor

Thanks 👍

@susiwen8
susiwen8 (susiwen8) deleted the 106824 branch January 19, 2021 06:39
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quick pick: selecting entry with keyboard does not put focus back to editor

3 participants