vazco / meteor-universe-autoform-select

Meteor universe autoform select
MIT License
16 stars 10 forks source link

Issue with versions #31

Closed chneau closed 5 years ago

chneau commented 8 years ago

Meteor methods call doesn't work (the value is never assigned, UI we can't assign a value in a selectize + meteorMethod).

I found that downgrading like this was working:

vazco:universe-selectize@=0.1.16 vazco:universe-autoform-select

I will keep update this I'm trying to search precisely why it's not working.

Regards, Charles

MichalW commented 8 years ago

Thanks, I reverted last pull request. Please try with 0.1.18 version

chneau commented 8 years ago

Hello, thanks for the quick response !

It is now working well, the user can select an option, it still on the autoform selectize and it doesn't disappear anymore. Well done !

Nieziemski commented 8 years ago

@CharlesNo , can you provide sample code affected by fix in version 0.1.17? I try to reproduce this bug but everything works as a charm for me. I tried autosave option on and of, multiple, optionsMethodParams as well, but still no effect. Any suggestions? Is there something specific about your project?

chneau commented 8 years ago

Hello @Nieziemski , I downgraded to 0.1.17 and it doesn't work, my package file includes this :

vazco:universe-selectize@=0.1.17
vazco:universe-autoform-select@=0.3.9

Then, I have an autoform generated from the schema :

  'tasks.$.location':
    type:String
    optional:false
    label:'Location'
    autoform:
      type:"universe-select"
      optionsMethod:'getOptionsLocations'

This is just an exemple but it was actually not working anywhere else. I show my form with a quickform.

My server method is just like one of the example. What happens is the following : I input some letters to find a location, I click on it, the select is blank. I did check in the websocket inspector and it looks like the value is not saved. Downgrading to 0.1.16 (and universe-autoform-select to 0.3.8) or upgrading to 0.1.18 (and universe-autoform-select to 0.3.9) looks to work fine.

My meteor method looks like this:

    getOptionsLocations:({searchText,values})->
      if !@userId then throw new Meteor.Error('not-authorized')
      @unblock()
      if searchText?
        return Locations.find({name:{$regex: searchText, $options: 'i'}}, {limit: 15}).map((d)->{label:d.name,value:d._id})
      if values.length
        return Locations.find({_id:{$in:values}}).map((d)->{label:d.name,value:d._id})
      return Locations.find({}, {limit:15,sort:{name:1}}).map((d)->{label:d.name,value:d._id})