From 1267048d04b7a28389c1830c15e4f008d56506e8 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Fri, 21 Jun 2024 17:09:33 +0200
Subject: [PATCH] chore: #200 move to close

---
 development/issues/closed/200.html | 28 ++++++++++++++++++++++++++++
 development/issues/closed/200.mjs  | 25 +++++++++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 development/issues/closed/200.html
 create mode 100644 development/issues/closed/200.mjs

diff --git a/development/issues/closed/200.html b/development/issues/closed/200.html
new file mode 100644
index 000000000..293692525
--- /dev/null
+++ b/development/issues/closed/200.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en" data-monster-theme-name="dark-mode">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Reloading options in a select does not work #200</title>
+    <script src="./200.mjs" type="module"></script>
+</head>
+<body>
+<h1>Reloading options in a select does not work #200</h1>
+<p>If a URL is changed and reloaded in a select, the result of the selection is incorrect.</p>
+<ul>
+    <li><a href="https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/200">Issue #200</a></li>
+    <li><a href="/">Back to overview</a></li>
+</ul>
+<main>
+
+    <button id="load-next">load next url</button>
+    <hr>
+    <monster-select 
+            data-monster-option-url="/issue-200-1.json"
+            data-monster-option-mapping-labeltemplate="name"
+            data-monster-option-mapping-valuetemplate="id"
+    ></monster-select>
+
+</main>
+</body>
+</html>
diff --git a/development/issues/closed/200.mjs b/development/issues/closed/200.mjs
new file mode 100644
index 000000000..b20f655e6
--- /dev/null
+++ b/development/issues/closed/200.mjs
@@ -0,0 +1,25 @@
+/**
+ * @file development/issues/open/200.mjs
+ * @url https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/200
+ * @description Reloading options in a select does not work
+ * @issue 200
+ */
+
+import "../../../source/components/style/property.pcss";
+import "../../../source/components/style/normalize.pcss";
+import "../../../source/components/style/typography.pcss";
+import "../../../source/components/style/link.pcss";
+import "../../../source/components/style/color.pcss";
+import "../../../source/components/form/select.mjs";
+
+
+document.querySelector("#load-next").addEventListener("click", (e) => {
+
+    const json1 = "/issue-200-1.json"
+    const json2 = "/issue-200-2.json"
+
+    const select = document.querySelector("monster-select");
+    console.log(select.getOption("url") === json1)
+    select.setOption("url", select.getOption("url") === json1 ? json2 : json1);
+    select.fetch();
+})
\ No newline at end of file
-- 
GitLab