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

Deps => @rules[@matched] is null #35

Closed
pascoual opened this issue May 1, 2014 · 9 comments
Closed

Deps => @rules[@matched] is null #35

pascoual opened this issue May 1, 2014 · 9 comments

Comments

@pascoual
Copy link
Contributor

pascoual commented May 1, 2014

Hi,

When using space as token (token: ' ') it works untill reactive data has changed. And we get this:

Exception from Deps recompute function: TypeError: Cannot read property 'template' of undefined
    at AutoComplete.AutoComplete.currentTemplate (http://localhost:3030/packages/autocomplete.js?61a337ba64b04a2913ac3f7823bff5325a790495:724:36)
    at Object.Template._autocompleteContainer.itemTemplate (http://localhost:3030/packages/autocomplete.js?61a337ba64b04a2913ac3f7823bff5325a790495:835:13)
    at UI.Component.lookup (http://localhost:3030/packages/blaze-layout.js?58621fa8e3ed65d10240815d5ba3fb34e2e9fdc5:520:21)
    at Spacebars.call (http://localhost:3030/packages/spacebars.js?f49560fc90a8d71b7637d9596696078881b8c812:173:18)
    at Spacebars.mustacheImpl (http://localhost:3030/packages/spacebars.js?f49560fc90a8d71b7637d9596696078881b8c812:110:25)
    at Object.Spacebars.dataMustache (http://localhost:3030/packages/spacebars.js?f49560fc90a8d71b7637d9596696078881b8c812:142:39)

Thanks.
Pascal

@mizzao
Copy link
Collaborator

mizzao commented May 1, 2014

I'm not sure if using spaces as tokens is something that we can really support, given how it is used to determine the beginning and end of search strings.

In any case, I can consider your use case. Can you provide a meteor app that reproduces this, please?

@pascoual
Copy link
Contributor Author

pascoual commented May 2, 2014

Hi mizzao,

Seem not to be linked with 'space' but with deps.

To reproduce:
Clone https://github.com/pascoual/meteor-autocomplete-issue35

  1. Add some usernames in the input with @
  2. Submit the form (get errors in console)
    => broken, cannot add usernames

Thanks.
Pascal

@pascoual pascoual changed the title Token: ' ' => @rules[@matched] is null Deps => @rules[@matched] is null May 8, 2014
@pascoual
Copy link
Contributor Author

pascoual commented May 8, 2014

Hi Andrew,

Did you find something on this deps error ?

Thanks.
Pascal

mizzao referenced this issue in jsep/meteor-autocomplete May 12, 2014
@mizzao
Copy link
Collaborator

mizzao commented May 13, 2014

Hi @pascoual,

I took a look at your demo and it appears this is a duplicate of #30 - being unable to use the autocomplete with a changing data context or helpers.

On https://github.com/pascoual/meteor-autocomplete-issue35/blob/master/autocomplete-issue35.html#L25 you have value=userList. If you just change this to value="" or any other static error the error no longer occurs.

I'm going to update the way this works once the new Blaze API comes out (https://meteor.hackpad.com/Blaze-Proposals-for-v0.2-hsd54WPJmDV) but for now I'm probably just going to wait a bit until better Blaze component tools come out.

dandv referenced this issue May 13, 2014
@mizzao, is this what should happen when @matched === -1? That happens with a nabvar autocomplete after a Router.go(...) called from its callback.
@dandv
Copy link
Collaborator

dandv commented May 13, 2014

Hey @pascoual: I ran into the same error while using a token-less autocomplete. Fixed it with commit b61fc4c. Maybe it works for you too?

@pascoual
Copy link
Contributor Author

Hi,

@dandv : don't get the error anymore but don't works better, completion is ko after a collection update.

@mizzao : yes setting value="" let autocompletion works but I need a way to init this value :). So I've added {reactive: false} to userList helper and all goes right untill concurrent modifications of the field.

We will wait Blaze V0.2 ;).
Thanks.

@mizzao
Copy link
Collaborator

mizzao commented May 14, 2014

Hi @pascoual: I've pushed a change that will re-render the autocomplete to deal with updated data contexts. I've verified that this fixes the issue on your repo. Can you try it and confirm for me please?

@mizzao
Copy link
Collaborator

mizzao commented May 14, 2014

0.4.4 is released and I believe it fixes this issue. Please re-open if this is not the case.

@mizzao mizzao closed this as completed May 14, 2014
@pascoual
Copy link
Contributor Author

@mizzao perfect !
Thanks.

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

3 participants