From c9a58720509583e95313cca6051e5ce7cd9297c4 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 24 Jun 2024 22:06:45 +0200 Subject: [PATCH] fix(FilePicker): Forward update of `currentPath` to `navigatedPath` Allow to use `:path.sync="currentPath"` and fixes regression where changing the folder by clicking a folder in the file list does not navigate to that folder. Signed-off-by: Ferdinand Thiessen --- lib/components/FilePicker/FilePicker.vue | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/components/FilePicker/FilePicker.vue b/lib/components/FilePicker/FilePicker.vue index f0e43ce9..5f3ab0da 100644 --- a/lib/components/FilePicker/FilePicker.vue +++ b/lib/components/FilePicker/FilePicker.vue @@ -22,10 +22,9 @@
+ @create-node="onCreateFolder" />

{{ viewHeadline }}

@@ -212,10 +211,16 @@ watch([navigatedPath], () => { /** * The current path that should be picked from */ -const currentPath = computed(() => - // Only use the path for the files view as favorites and recent only works on the root - currentView.value === 'files' ? navigatedPath.value || props.path || savedPath.value : '/', -) +const currentPath = computed({ + get: () => { + // Only use the path for the files view as favorites and recent only works on the root + return currentView.value === 'files' ? navigatedPath.value || props.path || savedPath.value : '/' + }, + set: (path: string) => { + // forward setting the current path to the navigated path + navigatedPath.value = path + }, +}) /** * A string used to filter files in current view