Skip to content

Commit

Permalink
Fix: error when flatpickr instance not yet set (#238)
Browse files Browse the repository at this point in the history
In some situations like when navigating to a page with vue-router / inertiajs that is having this component you will see `Uncaught (in promise) TypeError: Cannot read property 'emitsOptions' of null`
  • Loading branch information
eklundkristoffer authored Aug 25, 2021
1 parent 96ff559 commit 8661b59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ export default {
config: {
deep: true,
handler(newConfig) {
if (!this.fp) {
return;
}

let safeConfig = cloneObject(newConfig);
// Workaround: Don't pass hooks to configs again otherwise
// previously registered hooks will stop working
Expand Down

0 comments on commit 8661b59

Please sign in to comment.