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

fix: update value direct from control #302

parent ba422d6f
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>passwort update value issue #302</title>
<script src="./302.mjs" type="module"></script>
</head>
<body>
<h1>passwort update value issue #302</h1>
<p></p>
<ul>
<li><a href="https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/302">Issue #302</a></li>
<li><a href="/">Back to overview</a></li>
</ul>
<main>
<!-- Write your code here -->
<monster-login
data-monster-option-fetch-login-url="/issue-299/login"
data-monster-option-fetch-digits-url="/issue-299/digits"
data-monster-option-fetch-secondfactor-url="/issue-299/secondFactorDigits"
data-monster-option-fetch-forgotpassword-url="/issue-299/forgot-password"
id="password"></monster-login>
</main>
</body>
</html>
/**
* @file development/issues/open/302.mjs
* @url https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/302
* @description passwort update value issue
* @issue 302
*/
import "../../../source/components/style/property.pcss";
import "../../../source/components/style/link.pcss";
import "../../../source/components/style/color.pcss";
import "../../../source/components/style/theme.pcss";
import "../../../source/components/style/normalize.pcss";
import "../../../source/components/style/typography.pcss";
import "../../../source/components/form/login.mjs";
customElements.whenDefined("monster-password").then(() => {
const elem = document.getElementById("password");
elem.focus()
elem.addEventListener("keydown", (event) => {
if (event.key === "Enter") {
console.log("Enter key pressed: ", elem.value);
}
});
})
......@@ -487,7 +487,7 @@ function getTranslations() {
case "hi":
return {
username: "उपयोकर नम य ई-मल",
username: "उपयो\A4\97कर नम य ई-मल",
password: "पसवर",
login: "लग इन कर",
forgotPasswordLink: "पसवर भल गए?",
......@@ -1082,6 +1082,7 @@ function initEventHandler() {
const username = this.shadowRoot.querySelector(
"input[name='username']",
).value;
const password = this.shadowRoot.querySelector("monster-password").value;
let missingBits = 0;
......
......@@ -90,9 +90,7 @@ class Password extends CustomControl {
* @return {string}
*/
get value() {
const obj = this.getInternalUpdateCloneData();
this.value = obj.value;
return obj.value;
return this[inputElementSymbol].value;
}
/**
......@@ -101,6 +99,7 @@ class Password extends CustomControl {
*/
set value(value) {
this.setOption("value", value);
this[inputElementSymbol].value=value;
this.setFormValue(value);
}
......@@ -262,7 +261,6 @@ function getTemplate() {
inputmode path:inputmode,
aria-required path:aria.required,
aria-placeholder path:aria.placeholder"
data-monster-bind="path:value"
>
<svg viewBox="0 0 16 16" data-monster-role="visible-icon" class="hidden">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment