Skip to content

Commit

Permalink
Merge pull request #69 from dhershman1/development
Browse files Browse the repository at this point in the history
v3.1.0
  • Loading branch information
dhershman1 authored Apr 6, 2022
2 parents 1d39923 + 3ab3d24 commit e1a7f18
Show file tree
Hide file tree
Showing 6 changed files with 920 additions and 1,174 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
test.html
test-func.html
test-vue3.html
test-vuetify.html

dist/

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## v3.1.0

### Improved

- Now using vNode instead of raw events, this allows us to use events no matter how deep [#66](https://github.com/dhershman1/vue-debounce/issues/66)
- The above improves compatability with libraries like Vuetify

### Chore

- Dependency Updates and Audit fixes

## v3.0.2

### New
Expand Down
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,10 @@ Hopefully in the future Vue will allow directives to type the modifiers and valu

## Caveats

There is a caveat explained in issue [#36](https://github.com/dhershman1/vue-debounce/issues/36) which states you're unable to intercept manually triggered events automatically and instead have to trigger the debounced function at the catching point.
If a library you are using such as `Vueftify` is already using a specified event, it will block vue debounce from being able to listen to that event.

For example, if you have a custom component that is manually firing an input event back to the parent, you might do something like this:

```vue
<CustomComponent
v-model="options"
@input="debouncedSelectUpdate"
/>
```

Where `debounceSelectedUpdate` looks like this:

```js
debounceSelectedUpdate () {
return debounce(() => {
// Taken from issue #36 as an example
this.refreshDefaultSelect()
}, 300)
}
```
As of `v3.1.0` I have significantly improved compatability with these kinds of libraries, however this problem still remains.

For example, Vuetify makes pretty heavy use of the `onblur` event for a lot of it's styles/animatons, so I'd recommend telling vue-debounce to listen for `focusout` instead, if you want debounce to trigger on a blur like event.

Or have a method that handles it for you and calls debounce etc. If anyone has advice on handling manual vue events automatically please don't hesitate to share!
I will keep doing research into a better way to solve this little issue, but for now the improved compatability should help a lot!
Loading

0 comments on commit e1a7f18

Please sign in to comment.