Skip to content

Callback actions raise error in select2 pattern #1470

@laulaz

Description

@laulaz

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 :

if (this.options.debug) {

Uncaught TypeError: this is undefined

The function is never called.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions