From abe7777b0a1cc4b3129c608cc109db53e2f7085b Mon Sep 17 00:00:00 2001 From: Lito Date: Tue, 29 Oct 2013 11:23:56 +0100 Subject: [PATCH] Fixed string used as regular expression for ID attribute. Signed-off-by: Igor Vaynberg --- select2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 4975b2f3..751815c0 100644 --- a/select2.js +++ b/select2.js @@ -669,8 +669,8 @@ the specific language governing permissions and limitations under the Apache Lic this.container = this.createContainer(); - this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()); - this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1'); + this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()).replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1'); + this.containerSelector="#"+this.containerId; this.container.attr("id", this.containerId); // cache the body so future lookups are cheap