Skip to content

Commit

Permalink
fix: handle escape while filename renaming (#495)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Nielsen <jimniels@gmail.com>
  • Loading branch information
davidfig and jimniels authored May 16, 2023
1 parent 7aeafb3 commit 1db1a4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ui/menus/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ function FileRename({
if (e.key === 'Enter') {
inputRef.current?.blur();
focusGrid();
} else if (e.key === 'Escape') {
if (inputRef.current) {
inputRef.current.value = currentFilename;
inputRef.current.blur();
}
focusGrid();
}
}}
onBlur={(e: React.FocusEvent<HTMLInputElement>) => {
Expand Down

1 comment on commit 1db1a4a

@vercel
Copy link

@vercel vercel bot commented on 1db1a4a May 16, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

quadratic – ./

quadratic-git-main-quadratic.vercel.app
quadratic-nu.vercel.app
quadratic-quadratic.vercel.app

Please sign in to comment.