Skip to content

Commit

Permalink
refactor: Avoid breaking change for Autocomplete (debounce prop renam…
Browse files Browse the repository at this point in the history
…ed back to delay)
  • Loading branch information
rstoenescu committed Feb 4, 2017
1 parent ec5ebbc commit ab153b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions dev/components/form/autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
On desktop, Escape key closes the suggestions popover and you can navigate with keyboard arrow keys. Selection is made with either mouse/finger tap or by Enter key.
</p>

<q-autocomplete v-model="terms" @search="search" @selected="selected" :debounce="0">
<q-autocomplete v-model="terms" @search="search" @selected="selected" :delay="0">
<q-search v-model="terms" placeholder="Start typing a country name" />
</q-autocomplete>

<br>

<p class="caption">Maximum of 2 results at a time</p>
<q-autocomplete v-model="terms" @search="search" :max-results="2" @selected="selected" :debounce="0">
<q-autocomplete v-model="terms" @search="search" :max-results="2" @selected="selected" :delay="0">
<q-search v-model="terms" />
</q-autocomplete>

Expand All @@ -32,14 +32,14 @@
<br>

<p class="caption">Static List</p>
<q-autocomplete v-model="terms" :static-data="{field: 'value', list: countries}" @selected="selected" :debounce="0">
<q-autocomplete v-model="terms" :static-data="{field: 'value', list: countries}" @selected="selected" :delay="0">
<q-search v-model="terms" placeholder="Featuring static data" />
</q-autocomplete>

<br>

<p class="caption">Delimiter between results</p>
<q-autocomplete v-model="terms" delimiter @search="search" @selected="selected" :debounce="0">
<q-autocomplete v-model="terms" delimiter @search="search" @selected="selected" :delay="0">
<q-search v-model="terms" />
</q-autocomplete>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/vue-components/autocomplete/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
type: Number,
default: 6
},
debounce: {
delay: {
type: Number,
default: 500
},
Expand Down Expand Up @@ -160,7 +160,7 @@ export default {
},
__delayTrigger () {
clearTimeout(this.timer)
this.timer = setTimeout(this.trigger, this.staticData ? 0 : this.debounce)
this.timer = setTimeout(this.trigger, this.staticData ? 0 : this.delay)
},
__handleKeypress (e) {
switch (e.keyCode || e.which) {
Expand Down

0 comments on commit ab153b5

Please sign in to comment.