arillo-ch/silverstripe-multiselectfield

Javascript Errors?

Closed this issue · 2 comments

Hi,

Thanks for the new plain javascript version of Kinglozzers module. Do you have any idea why these errors are produced in the console on loading a DO with the multiselectfield?

Uncaught SyntaxError: missing } after property list note: { opened at line 3, column 31

Alpine Expression Error: missing } after property list
Expression: "{title: 'My DataObject's Data', visible: true, value: 729}"

  <div class="multiselectfield-item-title multiselectfield-item-title-sortable" :class="getSelected(729) &amp;&amp; sortable &amp;&amp; 'multiselectfield-item-title-sortable'">
    <span x-show="getSelected(729) &amp;&amp; sortable" class="font-icon-drag-handle multiselectfield-item-title-dragger"></span>
    My DataObject's Data
  </div>
  <button class="multiselectfield-item-action font-icon-minus multiselectfield-item-action-remove" :class="getSelected(729) ? 'font-icon-minus multiselectfield-item-action-remove' : 'font-icon-plus-1 multiselectfield-item-action-add'" @click="move" type="button">
    <span class="sr-only" x-text="getSelected(729) ? `Remove item`: `Add item`">Remove item</span>
  </button>
</li>```


Is the console log for every data item in my returned list. Obviously My DataObject's Data is the actual title returned :)

Hi @mspacemedia glad it is useful to you. I guess it is because of the ' in My DataObject's Data. I guess that value should be escaped. Will take a look and fix soon.