Closed AnomalousBit closed 1 month ago
Should fix #1036
Thanks for this! Can you add a unit test for this that would have failed previously but now passes with your change?
Thanks, I've implemented a more comprehensive fix as part of https://github.com/Choices-js/Choices/pull/1166
Description
When providing a JSON encoded
data-custom-properties
attribute on the original<option>
elements, attempting to access thedataset.customProperties
later, inside of a Choices event would return an improperly encoded"[object Object]"
string instead of the expected JSON object.This PR fixes the option template attribute for data-custom-properties by using JSON.stringify() before attempting to covert customProperties into a string.
Several issues open around custom properties may be fixed by this PR.
Screenshots (if appropriate)
Types of changes
Checklist