Skip to content

Commit 9c8b500

Browse files
authored
Merge pull request #55666 from nextcloud/fix/53038/clear-search
2 parents ea8ab8e + 4e87741 commit 9c8b500

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

apps/files/src/components/FilesNavigationSearch.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ const searchStore = useSearchStore()
2424
* we need to clear the search box.
2525
*/
2626
onBeforeNavigation((to, from, next) => {
27-
if (to.params.view !== VIEW_ID && from.params.view === VIEW_ID) {
28-
// we are leaving the search view so unset the query
27+
if (to.params.view !== VIEW_ID
28+
&& (from.params.view === VIEW_ID || from.query.dir !== to.query.dir)) {
29+
// we are leaving the search view or navigate to another directory -> unset the query
2930
searchStore.query = ''
3031
searchStore.scope = 'filter'
3132
} else if (to.params.view === VIEW_ID && from.params.view === VIEW_ID) {

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)