Skip to content

.select2("data") in Chrome fails when data set with .select2("val", ????) #2103

@ghost

Description

Using Chrome Version 32.0.1700.107 m (and whatever I had before I decided to update to see if the latest version worked), I found that setting the selected values via val, such as:

$("select").select2("val", ["CA","MA"]);

then attempting to access any selected data via data such as:

$("select").select2("data");

will not work. It fails and does not produce any return values.

Case in point, the demo site for select2: http://ivaynberg.github.io/select2/

if you go to the "Programmatic Access" section, under the multiple selection buttons, click "Set to California and Massachusetts" then click "Alert selected value using data" will fail with this error in the Chrome console:

Uncaught TypeError: Converting circular structure to JSON 

This works in IE11 (didn't check below) and FF 26.0 but not Chrome.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions