Skip to content
Snippets Groups Projects
Verified Commit 1267048d authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: #200 move to close

parent ab844a85
No related branches found
No related tags found
No related merge requests found
<!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>
/**
* @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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment