ElevateDev / meteor-autoform-nouislider

MIT License
9 stars 19 forks source link

Bug: This package disableds ``autoform.optional=false`` standard behaviour #12

Closed thebarty closed 8 years ago

thebarty commented 8 years ago

Hi guys,

first of all: thanks a lot for this package!

BUT for me it is unusable as it disables autoform.optional=false standard behavior.

A configuration like below won't work as excpected, because noUiSlider will ALWAYS set a value, even if the user has NOT touched the slider.

A possible solution might be to registered a ReactiveVar that knows if the user has clicked/touched the slider and it returns "value not set" if the compoment has NOT been clicked.

Example: optional: false does NOT work as expected and will ALWAYS set a value, even if the user has NOT touched the element:

Schema = new SimpleSchema({
  scale: {
    type: Number,
    optional: false,  // BUG: even if the user DOES NOT touch this slider,
                      // a value of 1 will be set!
    min: 1,
    max: 10,
    autoform: {
      type: 'noUiSlider',
    }
  },
});  
jimmiebtlr commented 8 years ago

I believe this is fixed in 0.0.7, would you double check.