Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization errors with bootstrap-vue components #4

Closed
paweld2 opened this issue May 31, 2019 · 3 comments
Closed

Initialization errors with bootstrap-vue components #4

paweld2 opened this issue May 31, 2019 · 3 comments

Comments

@paweld2
Copy link

paweld2 commented May 31, 2019

Hello.

When using vuex-pagination with bootstrap-vue, specifically component <b-form-input>, there is an error on the initialization of vuex-pagination:

Cannot read property 'selectionStart' of undefined
    at VueComponent.get (form-selection.js?10fc:10)
    at VueComponent.computedGetter [as selectionStart] (vue.runtime.esm.js?2b0e:4842)
    at eval (index.js?2896:64)
    at Array.forEach (<anonymous>)
    at VueComponent.created (index.js?2896:63)

The error is because the property selectionStart uses a not initialized reference to the input field:
https://github.com/bootstrap-vue/bootstrap-vue/blob/dev/src/mixins/form-selection.js#L8

on the vuex-pagination code, the problem is that all the properties are retrieved to verify if there are a instance of vuex-pagination:
https://github.com/cyon/vuex-pagination/blob/master/index.js#L64

Does it make sense to change vuex-pagination logic to verify a optional marker on the components, like 'this.enableVuexPagination' to search for instances?

@MaxGfeller
Copy link
Contributor

Hi @paweld2, thanks for the issue and the pull request.

The whole goal of checking for the _meta attribute on computed getters was, that it's simple to use and doesn't require manual initializing. But i see that this can be a problem in some cases.

However, i'm sure we could solve that in a way that would not require an additional argument like enableVuexPagination.

I'll look into it but let me know if you know anything!

@MaxGfeller
Copy link
Contributor

@paweld2 I found a way to easily solve this, check 1807db0 and 0990031. It's already released as 1.2.9.

@paweld2
Copy link
Author

paweld2 commented Jun 1, 2019

Great solution. Thank You!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants