Skip to content

Commit 5fe7491

Browse files
committed
feat(FilterPanel): add enter event when creating new favorite (+ back button)
1 parent f74f8b7 commit 5fe7491

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

components/Panel/Item/FilterPanel.vue

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
</div>
99

1010
<div class="input-favorite-wrapper" v-else-if="favorite && $auth.loggedIn && createFavoriteInput">
11-
<ValidationObserver v-slot="{valid}">
11+
<ValidationObserver v-slot="{valid}" tag="form" @submit.prevent="validateBeforeSubmit">
1212
<ValidationProvider name="name" rules="required">
1313
<input v-model="favoriteName" type="text" placeholder="Nommer le favori" class="input--primary-color">
1414
</ValidationProvider>
15-
<button :disabled="!valid" type="submit" @click="validateBeforeSubmit"
16-
:class="{'button--primary-color': !valid, 'button--primary-color-reverse': valid}">OK
17-
</button>
15+
16+
<div>
17+
<button :disabled="!valid" type="submit" @click="validateBeforeSubmit"
18+
:class="{'button--primary-color': !valid, 'button--primary-color-reverse': valid}">OK
19+
</button>
20+
<button type="submit" @click="closeFavoriteInput" class="button--red-reverse">Annuler</button>
21+
</div>
1822
</ValidationObserver>
1923
</div>
2024
</transition>
@@ -312,6 +316,10 @@
312316
this.createFavoriteInput = true;
313317
}
314318
319+
closeFavoriteInput() {
320+
this.createFavoriteInput = false;
321+
}
322+
315323
/**
316324
* Apply the search request of the user
317325
*/
@@ -493,15 +501,25 @@
493501
margin-top: 30px;
494502
margin-bottom: 15px;
495503
496-
> span {
504+
> form {
505+
display: flex;
506+
flex-direction: column;
507+
}
508+
input {
509+
width: 100%;
510+
}
511+
512+
div {
513+
margin-top: 10px;
514+
497515
display: flex;
498-
align-items: center;
499516
justify-content: space-between;
500517
}
501518
502519
button {
503520
padding: 8px 14px;
504521
height: 40px;
522+
width: 48%;
505523
margin-top: 0;
506524
}
507525
}

0 commit comments

Comments
 (0)