Skip to content

Commit

Permalink
Merge branch 'fix_optgroup' into multiple_element_search
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmy committed May 16, 2018
2 parents 2d75f9c + 4e6278b commit bbd816a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/macro.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
}

// another way - w/o search field.
$this->script("jQuery.find(\".select2-results__options .select2-results__option:contains('{$value}')\")[0].click()");
$field = \str_replace('\\', '\\\\', $field);
$this->script("jQuery(\"$field\").val((function () { return jQuery(\"$field option:contains('$value')\").val(); })()).trigger('change')");

return $this;
});

0 comments on commit bbd816a

Please sign in to comment.