mockup
mockup copied to clipboard
Callback actions raise error in select2 pattern
On Plone 6.1, I'm trying to use the select2 pattern with callback action for onSelected (but this also applies to onSelecting, onDeselecting, onDeselected).
If I pass the callback as a string referencing an existing JS function via pattern options (options["onSelected"] = "myFunction"), the JS throws an error at this line after a selection has been made in the select2 field :
https://github.com/plone/mockup/blob/253d77a91ac159c2c57c75eda129d9d2aabaf4df/src/pat/select2/select2.js#L133
Uncaught TypeError: this is undefined
The function is never called.
Are you able to create a fixing PR ?