mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
Better storage file renaming (#21231)
This commit is contained in:
1 parent
2a8fe826bd
commit
dfe0fe0340
1 file changed
+7
-1
+7
-1
@@ -34,7 +34,13 @@ const FileExplorerRowEditing = ({ item, view, columnIndex }: FileExplorerRowEdit
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (inputRef.current) inputRef.current.select()
|
||||
// select just the name of the file without the extension
|
||||
if (inputRef.current) {
|
||||
const dotIndex = item.name.lastIndexOf('.')
|
||||
const selectionEnd = dotIndex !== -1 ? dotIndex : item.name.length
|
||||
inputRef.current.setSelectionRange(0, selectionEnd)
|
||||
inputRef.current.focus()
|
||||
}
|
||||
|
||||
// [Joshen] Esc should revert changes
|
||||
const handleEsc = (event: KeyboardEvent) => {
|
||||
|
||||
Reference in new issue
Block a user