1
0
mirror of synced 2025-02-03 21:59:24 +03:00
Maybe the fix is a bit ugly, but what it does is to make sure that we don't already have a select2-hidden-accessible span before we create a new one. Tested in several scenarios in our application and has solved the issue for us.
This commit is contained in:
torke1 2014-08-13 17:27:07 +02:00
parent 6df22fc4a8
commit 651047d52a

View File

@ -699,12 +699,15 @@ the specific language governing permissions and limitations under the Apache Lic
this.container = this.createContainer();
this.liveRegion = $("<span>", {
role: "status",
"aria-live": "polite"
})
.addClass("select2-hidden-accessible")
.appendTo(document.body);
this.liveRegion = $('.select2-hidden-accessible');
if (this.liveRegion.length == 0) {
this.liveRegion = $("<span>", {
role: "status",
"aria-live": "polite"
})
.addClass("select2-hidden-accessible")
.appendTo(document.body);
}
this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
this.containerEventName= this.containerId