chartjs / chartjs-plugin-annotation

Annotation plugin for Chart.js
MIT License
603 stars 325 forks source link

Fix value stored in element options for indexable option #860

Closed stockiNail closed 1 year ago

stockiNail commented 1 year ago

The PR https://github.com/chartjs/chartjs-plugin-annotation/pull/801 introduced indexable options (font and color).

The current options resolution is checking if the options is indexable and if true, it stores the value of the options.

https://github.com/chartjs/chartjs-plugin-annotation/blob/bc38d6bfad27a052c199604e89d1338c07681d3f/src/elements.js#L134

In this way, it stores a Proxy object (or an array of Proxy) in element options, something that probably you don't want.

This PR is storing "plain" objects as element.options.

stockiNail commented 1 year ago

Thank youu @kurkle