Skip to content

Commit a2c0652

Browse files
authored
Merge pull request #2384 from max65482/fix/reset-filter-string-when-navigating
fix(FilePicker): reset filter string when navigating
2 parents 719f730 + 7ada357 commit a2c0652

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lib/components/FilePicker/FilePicker.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ const currentPath = computed({
193193
*/
194194
const selectedFiles = shallowRef<INode[]>([])
195195
196+
/**
197+
* A string used to filter files in current view
198+
*/
199+
const filterString = ref('')
200+
196201
const {
197202
files,
198203
folder: currentFolder,
@@ -208,6 +213,8 @@ watch([navigatedPath], () => {
208213
}
209214
// Reset selected files
210215
selectedFiles.value = []
216+
// Reset filter string
217+
filterString.value = ''
211218
})
212219
213220
/**
@@ -257,11 +264,6 @@ async function handleButtonClick(callback: IFilePickerButton['callback'], nodes:
257264
*/
258265
const viewHeadline = computed(() => currentView.value === 'favorites' ? t('Favorites') : (currentView.value === 'recent' ? t('Recent') : ''))
259266
260-
/**
261-
* A string used to filter files in current view
262-
*/
263-
const filterString = ref('')
264-
265267
const { isSupportedMimeType } = useMimeFilter(toRef(props, 'mimetypeFilter')) // vue 3.3 will allow cleaner syntax of toRef(() => props.mimetypeFilter)
266268
267269
onMounted(() => loadFiles())

0 commit comments

Comments
 (0)