From 5ea885dfb5d71a463f088eb9dd4bef487f739503 Mon Sep 17 00:00:00 2001 From: Marek Sebera Date: Wed, 13 Sep 2023 09:41:17 +0200 Subject: [PATCH] version 2.1.1, resolved issue #1 --- CHANGELOG.md | 4 ++ demo_multiple.html | 115 ++++++++++++++++++++++++++++++++++++++ jquery.chained.selects.js | 2 +- package.json | 2 +- 4 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 demo_multiple.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a4d5a8..3123796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,3 +34,7 @@ ## 2.1.0 Added option `autoSelectSingleOptions` to allow automatic pre-selection of option if there is only single one (works recursively) + +## 2.1.1 + + Multiple instances on the same page should now work without cross-contamination diff --git a/demo_multiple.html b/demo_multiple.html new file mode 100644 index 0000000..4f64404 --- /dev/null +++ b/demo_multiple.html @@ -0,0 +1,115 @@ + + + + + + + jQuery Chained Selects Demo + + + +
+

Form Example

+
+
+

First Chain

+
+
+

Second Chain

+
+ +
+

Test your JSON Data

+ + +
+ + + + + + + diff --git a/jquery.chained.selects.js b/jquery.chained.selects.js index 95d9f97..17c3155 100644 --- a/jquery.chained.selects.js +++ b/jquery.chained.selects.js @@ -17,7 +17,7 @@ function ChainedSelect(element, options) { this.element = $(element); - this.options = $.extend(defaults, options); + this.options = $.extend({}, defaults, options); this.init(); } diff --git a/package.json b/package.json index 166b0b3..e5b655e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jquery-chained-selects", - "version": "2.1.0", + "version": "2.1.1", "description": "jQuery plugin to create chained selects from JSON data", "main": "jquery.chained.selects.js", "scripts": {