Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for assignment of customProperties in the option template #1083

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AnomalousBit
Copy link

Description

When providing a JSON encoded data-custom-properties attribute on the original <option> elements, attempting to access the dataset.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

  • Chore (tooling change or documentation change)
  • Refactor (non-breaking change which maintains existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • I have added new tests for the bug I fixed/the new feature I added.
  • I have modified existing tests for the bug I fixed/the new feature I added.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@tagliala
Copy link

Should fix #1036

@mtriff
Copy link
Member

mtriff commented Dec 16, 2022

Thanks for this! Can you add a unit test for this that would have failed previously but now passes with your change?

@mtriff mtriff added the changes required Pull request requires changes before it can be merged label Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required Pull request requires changes before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants