Skip to content

Commit a30c04b

Browse files
committed
UX: Adjust config of places search autocomplete component #465 photoprism#5080
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent 056c6f3 commit a30c04b

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

frontend/src/component/position/dialog.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
>
4444
<div>
4545
<v-autocomplete
46+
ref="search"
4647
v-model="selectedPlace"
4748
:items="searchResults"
4849
:loading="searchLoading"
@@ -54,9 +55,12 @@
5455
item-title="formatted"
5556
item-value="id"
5657
return-object
58+
auto-select-first
59+
clear-on-select
5760
clearable
5861
autocomplete="off"
5962
no-filter
63+
menu-icon=""
6064
:menu-props="{ maxHeight: 300 }"
6165
@update:search="onSearchQueryChange"
6266
@update:model-value="onPlaceSelected"
@@ -491,9 +495,7 @@ export default {
491495
this.currentLng = place.lng;
492496
this.updatePosition(place.lat, place.lng);
493497
this.fetchLocationInfo(place.lat, place.lng);
494-
495-
this.searchQuery = "";
496-
this.searchResults = [];
498+
this.clearSearch();
497499
this.searchLoading = false;
498500
if (this.searchTimeout) {
499501
clearTimeout(this.searchTimeout);

frontend/src/css/vuetify.css

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,21 @@ div.v-dialog.v-dialog--fullscreen > div.v-card {
233233
justify-content: flex-end;
234234
}
235235

236-
/* Lists */
236+
/* Lists and Menus */
237237

238238
.v-menu > .v-overlay__content > .v-list:not(.v-list--nav) {
239239
padding: 0;
240240
opacity: 0.97;
241241
}
242242

243+
.v-menu > .v-overlay__content > .v-list > .v-list-item.v-list-item--density-compact.v-list-item--one-line {
244+
line-height: 36px;
245+
min-height: 36px;
246+
padding-top: 6px;
247+
padding-bottom: 6px;
248+
padding-inline: 10px;
249+
}
250+
243251
/* Progress */
244252

245253
.v-progress-linear,
@@ -417,12 +425,8 @@ div.v-dialog.v-dialog--fullscreen > div.v-card {
417425
font-size: 0.75rem;
418426
}
419427

420-
.v-menu > .v-overlay__content > .v-list > .v-list-item.v-list-item--density-compact.v-list-item--one-line {
421-
line-height: 36px;
422-
min-height: 36px;
423-
padding-top: 6px;
424-
padding-bottom: 6px;
425-
padding-inline: 10px;
428+
.v-input--readonly .v-autocomplete__menu-icon {
429+
display: none;
426430
}
427431

428432
.p-clipboard > .v-speed-dial__content > .v-btn.v-btn--icon {

0 commit comments

Comments
 (0)