Skip to content

file-chooser: Handle Escape key in filename entry

Dylan McCall requested to merge dylanmccall/nautilus:filename-entry-fixes into main

When the user is typing in the filename entry, pressing Escape should cancel typing a filename, but not close the dialog. We will handle using a GtkShortcutController attached to the entry widget.

Fixes #3548


I added two more changes that I think are useful additions on top of the bug fix: revert the user's change to the filename if they press Escape, and also dismiss the filename entry if the user presses Enter. Just to cover all the usual bases with keyboard input.

(I have an inkling it might be good to actually navigate on activate if the user types a path into the filename entry, but that is also probably a bit complicated and maybe the file chooser should just be pickier about allowing filenames with directory separators in them :b).

Edited by Dylan McCall

Merge request reports

Loading