Skip to content

Commit

Permalink
[5.x] Improve UX of rename asset folder action (#10950)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Varga <jason@pixelfear.com>
  • Loading branch information
duncanmcclean and jasonvarga authored Oct 14, 2024
1 parent 1348a92 commit 6be88fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Actions/RenameAssetFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ protected function fieldItems()
'validate' => ['required', 'string', new AlphaDashSpace],
'classes' => 'mousetrap',
'focus' => true,
'default' => $value = $this->items->containsOneItem() ? $this->items->first()->basename() : null,
'placeholder' => $value,
'debounce' => false,
'autoselect' => true,
],
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/CP/Assets/BrowserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function folder(Request $request, $container, $path = '/')
'data' => [
'assets' => FolderAsset::collection($assets ?? collect())->resolve(),
'folder' => array_merge((new Folder($folder))->resolve(), [
'folders' => $folders->values(),
'folders' => Folder::collection($folders->values()),
]),
],
'links' => [
Expand Down

0 comments on commit 6be88fb

Please sign in to comment.