Can't change checkbox using $setState VDOM v3.1.0


#1

When using VDOM I can’t seem to change the state of the checkbox, it will show alway on. Any ideas?

I have tried the following

  • checked=“checked”

  • checked />

  • then I can’t toggle the checkbox.

            {{#if formData.checkbox}}
               <li class="checkbox">
                 <label class="item-checkbox item-content">
                   <input type="checkbox" name="fitImage" checked="checked" value="on" />
                   <i class="icon icon-checkbox">
                   </i>
                   <div class="item-inner">
                     <div class="item-title">Fit Image 1</div>
                   </div>
                 </label>
               </li>
           {{else}}
               <li class="checkbox">
                 <label class="item-checkbox item-content">
                   <input type="checkbox" name="fitImage" value="off" />
                   <i class="icon icon-checkbox"></i>
                   <div class="item-inner">
                     <div class="item-title">Fit Image 2</div>
                   </div>
                 </label>
               </li>
            {{/if}}
    

    this.$setState({
    formData: {
    checkbox: true,
    }
    });


#2

Update to 3.1.1, it was fix for boolean attributes in vdom


#3

Great! – working now.