Writing Custom Templates for Multiple Checkbox select retruns only the last value on Submit


This is my form schema,

moment_ids: {
type: Array,
label:"Best For",
autoform: {
      return Moments.find({}).map(function(v){
              return {"label":v.moment,"value":v._id._str};
'moment_ids.$': { 

This is my Overridden Template (custom template)

<template name="afCheckboxGroupInline_square_checkbox">
  <div class="ui segments no-border af-checkbox-group" {{dsk}}>
    {{#each this.items}}
    <div class="ui left floated compact segment mt5">
  <div style="position: absolute;top: 0;right: 0;" class="ui fitted checkbox">
    <input type="checkbox" id="{{atts.id}}_{{@index}}" value="{{this.value}}" {{atts}}>

When I use this custom template whenever I select the check boxes from my autoform on UI, It is returning only the last checkbox’s value (in an array) irrespective of the selection made.

Eg: These are the checkboxes generated & I have selected first three


When I submit the form I get only one value in an array, which is the last one (Night) which is not selected.


Am I doing it wrong? or Is that a Issue of Autoform ?!