Skip to content

Commit 7af149f

Browse files
committed
fix(Event): change keypress to keydown and add enter icon
1 parent 0a952e3 commit 7af149f

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

pages/administration/categories/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<h1>Gestion des catégories</h1>
1717

1818
<div class="header-wrapper">
19-
<div class="input-wrapper--with-icon">
19+
<div class="input-wrapper--with-icon input-with--enter-icon">
2020
<Icon type="search"/>
21-
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keypress.enter="debounceInput"
21+
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keydown.enter="debounceInput"
2222
placeholder="Rechercher">
2323
</div>
2424

pages/administration/exercices/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939

4040

4141
<div class="header-wrapper">
42-
<div class="input-wrapper--with-icon">
42+
<div class="input-wrapper--with-icon input-with--enter-icon">
4343
<Icon type="search"/>
44-
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keypress.enter="debounceInput"
44+
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keydown.enter="debounceInput"
4545
placeholder="Rechercher">
4646
</div>
4747

pages/administration/tags/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
<h1>Gestion des tags</h1>
2525

2626
<div class="header-wrapper">
27-
<div class="input-wrapper--with-icon">
27+
<div class="input-wrapper--with-icon input-with--enter-icon">
2828
<Icon type="search"/>
29-
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keypress.enter="debounceInput"
29+
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keydown.enter="debounceInput"
3030
placeholder="Rechercher">
3131
</div>
3232

pages/exercices/index.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div class="container--with-menu">
33
<div class="banner search-banner">
4-
<div class="input-wrapper--with-icon">
4+
<div class="input-wrapper--with-icon one-third input-with--enter-icon">
55
<Icon type="search"/>
6-
<input ref="inputText" class="input--primary-color" type="text" @keypress.enter="debounceInput"
6+
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keydown.enter="debounceInput"
77
placeholder="Rechercher">
88
</div>
99
</div>
@@ -89,6 +89,14 @@
8989
this.inputText.value = ""
9090
}
9191
92+
resetIfEmpty(e:any) {
93+
const value:string = e.target.value;
94+
95+
if(value === '') {
96+
this.$accessor.exercises.fetch({data: {title: ""}});
97+
}
98+
}
99+
92100
refreshInput() {
93101
this.inputText.value = this.$accessor.exercises.search_criterion.title || '';
94102
}

pages/gestion/mes-exercices/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
class="init">réinitialiser la recherche</span></div>
3838

3939
<div class="header-wrapper">
40-
<div class="input-wrapper--with-icon">
40+
<div class="input-wrapper--with-icon input-with--enter-icon">
4141
<Icon type="search"/>
42-
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keypress.enter="debounceInput"
42+
<input ref="inputText" class="input--primary-color" type="text" @input="resetIfEmpty" @keydown.enter="debounceInput"
4343
placeholder="Rechercher">
4444
</div>
4545

0 commit comments

Comments
 (0)