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

[preview-editor] Missing keyboard focus #7217

Closed
wants to merge 1 commit into from

Conversation

Anasshahidd21
Copy link
Contributor

@Anasshahidd21 Anasshahidd21 commented Feb 25, 2020

What it does

Fixes: #7170

When opening a file with with a single click from the File Explorer widget, the opened editor widget doesn't have keyboard focus. But now the focus is updated.

Signed-off-by: Muhammad Anas Shahid [email protected]

How to test

regardless of the preview editor being included in the app or not...
open one editor properly (double click)
then open a file with a single click
press ctrlcmd+f
reveal the first editor widget and see that the search widget is shown there

Review checklist

Reminder for reviewers

Fixes: eclipse-theia#7170
When opening a file with with a single click from the File Explorer widget, the opened editor widget doesn't have keyboard focus. But now the focus is updated.

Signed-off-by: Muhammad Anas Shahid <[email protected]>
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes fix the issue regarding the activation of the preview-editor.

I'm not sure about whether the fix is correct since we lose the ability to navigate the explorer using the keyboard (up, down) and trigger the opening of preview-editors. Now, since the editor is activated, our cursor or focus is added to the actual document and not kept on the tree. From the original pull-request (#3373) the following comment was by @akosyakov for a previous iteration:

clicking on a file in the navigator activates the preview editor, it would be better if the focus stays on the navigator, otherwise, i never can select a file in the navigator by clicking on it

If we are fine with this approach, do you mind updating the commit message to reflect that it also fixes the following issue (#5027)?

@vince-fugnitto vince-fugnitto added the editor-preview issues that are related to the editor-preview label Feb 25, 2020
@akosyakov
Copy link
Member

@vince-fugnitto #7170 (comment)

@akosyakov
Copy link
Member

When opening a file with with a single click from the File Explorer widget, the opened editor widget doesn't have keyboard focus. But now the focus is updated.

for the preview widget it is bogus, if you disable preview widget or uninstall editor preview extensions and it still happens for the normal editor then it is a bug, otherwise there is nothing to fix

@Anasshahidd21
Copy link
Contributor Author

The changes fix the issue regarding the activation of the preview-editor.

I'm not sure about whether the fix is correct since we lose the ability to navigate the explorer using the keyboard (up, down) and trigger the opening of preview-editors. Now, since the editor is activated, our cursor or focus is added to the actual document and not kept on the tree. From the original pull-request (#3373) the following comment was by @akosyakov for a previous iteration:

clicking on a file in the navigator activates the preview editor, it would be better if the focus stays on the navigator, otherwise, i never can select a file in the navigator by clicking on it

Thank you for your input, is there a better way you would suggest that could work in this case? @vince-fugnitto

If we are fine with this approach, do you mind updating the commit message to reflect that it also fixes the following issue (#5027)?

Even if this isn't the ideal approach, should I still include the issue in the fixes? Just so anyone in future who is trying to look at the issue might have reference to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-preview issues that are related to the editor-preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing keyboard focus when file opened via single click
3 participants