Skip to content

4.0.5 -> 4.0.7 select2.close event regresssion #5532

@drees

Description

@drees

Upgrading from 4.0.5 to 4.0.7 and ran into an issue where this code no longer works:

$(document).ready(function() {
  $("#select1").select2().select2("focus");
  $("select").on("select2:close", function (e) {
	 $("#checkbox1").focus();
	});
});

The goal is to auto-select the select2 on page load, then after the select2 is closed, focus on the next element. With 4.0.5 it works, with 4.0.7, the select2 element remains focused.

Example w/4.0.5 which works:
https://jsfiddle.net/bvL2wejz/

Example w/4.0.7 which doesn't work:
https://jsfiddle.net/4b0zy1hd/

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