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

New File dialog doesn't accept Enter for default #14146

Merged

Conversation

dhuebner
Copy link
Member

@dhuebner dhuebner commented Sep 6, 2024

What it does

Allow to accept the File Dialog by pressing Enter and canceling by pressing Escape.

See #13582

How to test

In theia-main-menu.test.ts the "Create file via New File menu and accept" test uses Enter to accept the File Dialog an save a file.

Or follow the description in #13582

Follow-ups

Review checklist

Reminder for reviewers

@tsmaeder
Copy link
Contributor

@dhuebner is this a problem on Mac only? I can accept the file dialog with enter on Windows.

@dhuebner
Copy link
Member Author

@tsmaeder
No, I don't think it is Mac specific. The problem was, that the tree widget eats the Enter and ESC key stroke events so that the dialog can not be closed using keyboard. One need to click on the corresponding buttons or use TAB to jump to them and then hit Enter.

@dhuebner
Copy link
Member Author

@tsmaeder
Now, I see. You need to use the menu "File" -> "New File...". Then save the untitled file and you will get this dialog.

@tsmaeder
Copy link
Contributor

That's what I'm doing: in the video, I just press "Enter" when the "Save as"-dialog opens. What am I missing?

2024-10-11.11-43-22.mp4

@dhuebner
Copy link
Member Author

@tsmaeder
The problem only occurs when running in the browser. In the electron version the system dialog is used and works fine.
Sorry for the confusion, I need to better explain how to test.

Copy link
Contributor

@tsmaeder tsmaeder left a comment

Choose a reason for hiding this comment

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

Seems to do the trick. I'm still not convinced we should not handle the keyboard focus differently, but that's a larger discussion.

@dhuebner dhuebner merged commit 9329805 into eclipse-theia:master Oct 29, 2024
11 checks passed
@dhuebner
Copy link
Member Author

@tsmaeder
Thank you for the review!

@dhuebner dhuebner deleted the dhuebner/fileDialog-enter-13582 branch October 29, 2024 09:01
@jfaltermeier jfaltermeier added this to the 1.55.0 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants