Skip to content

Commit

Permalink
Move label field back, don't open dropdown on quick menu open, and ui…
Browse files Browse the repository at this point in the history
…:fix'd
  • Loading branch information
Blackshadow8910 committed Jan 13, 2025
1 parent 2859ce5 commit 224b669
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion frontend/components/Base/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
clickOutsideToClose: {
type: Boolean,
default: false,
}
},
});
const modalBox = ref();
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/Form/Multiselect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<span class="label-text">{{ label }}</span>
</label>
<div class="dropdown dropdown-top sm:dropdown-end">
<div tabindex="0" class="flex min-h-[48px] w-full flex-wrap gap-2 rounded-lg border border-base-content border-opacity-20 p-4">
<div
tabindex="0"
class="flex min-h-[48px] w-full flex-wrap gap-2 rounded-lg border border-base-content border-opacity-20 p-4"
>
<span v-for="itm in value" :key="itm.id" class="badge">
{{ itm.name }}
</span>
Expand Down
12 changes: 7 additions & 5 deletions frontend/components/Item/CreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<template #title> {{ $t("components.item.create_modal.title") }} </template>
<form @submit.prevent="create()">
<LocationSelector v-model="form.location" />
<FormMultiselect v-model="form.labels" :label="$t('global.labels')" :items="labels ?? []" />
<FormTextField
ref="nameInput"
v-model="form.name"
Expand All @@ -18,6 +17,7 @@
:label="$t('components.item.create_modal.item_description')"
:max-length="1000"
/>
<FormMultiselect v-model="form.labels" :label="$t('global.labels')" :items="labels ?? []" />

<div class="modal-action mb-6">
<div>
Expand Down Expand Up @@ -143,17 +143,19 @@
watch(
() => modal.value,
(open) => {
open => {
if (open) {
useTimeoutFn(() => { focused.value = true }, 50);
useTimeoutFn(() => {
focused.value = true;
}, 50);
if (locationId.value) {
const found = locations.value.find(l => l.id === locationId.value);
if (found) {
form.location = found;
}
}
if (labelId.value) {
form.labels = labels.value.filter(l => l.id === labelId.value);
}
Expand Down
9 changes: 5 additions & 4 deletions frontend/components/Label/CreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@
watch(
() => modal.value,
(open) => {
open => {
if (open)
useTimeoutFn(() => { focused.value = true}, 50);
else
focused.value = false;
useTimeoutFn(() => {
focused.value = true;
}, 50);
else focused.value = false;
}
);
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/Location/CreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
watch(
() => modal.value,
(open) => {
open => {
if (open) {
useTimeoutFn(() => { focused.value = true}, 50);
useTimeoutFn(() => {
focused.value = true;
}, 50);
if (locationId.value) {
const found = locations.value.find(l => l.id === locationId.value);
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/global/QuickMenu/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@
unrefElement(inputBoxButton).click();
};
watch(inputBoxFocused, () => {
if (inputBoxFocused.value) revealActions();
else inputValue.value = "";
watch(inputBoxFocused, val => {
if (!val) inputValue.value = "";
});
watch(inputValue, (val, oldVal) => {
Expand Down
8 changes: 5 additions & 3 deletions frontend/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@
<button class="group" @click="btn.action">
{{ btn.name.value }}

<kbd v-if="btn.shortcut" class="kbd kbd-sm ml-auto hidden text-neutral-400 group-hover:inline">{{
btn.shortcut
}}</kbd>
<kbd
v-if="btn.shortcut"
class="kbd kbd-sm ml-auto hidden text-neutral-400 group-hover:inline"
>{{ btn.shortcut }}</kbd
>
</button>
</li>
</ul>
Expand Down

0 comments on commit 224b669

Please sign in to comment.