I'm using this simple HTML code that creates a password text box. In App Designer, I have an HTML component that I dragged and dropped from the side panel and set the Souce to be the HTML file.
When running the app from App Designer, the HTML component works as intended triggering the PasswordHTMLDataChanged(app, event) function when the password field has changed and storing the password for authentication.
When the App is compiled and run on WebApp, the HTML code does generate the text box but doesn't trigger the PasswordHTMLDataChanged(app, event) leaving my password variable empty.
This Web Application was working fine when running version 2022a but stopped working after the upgrade to 2023b.
Here's the HTML file:
<head>
<style>
div {
display: flex;
flex-direction: row;
}
input {
font-family: Helvetica;
font-size: 12px;
flex-grow: 2;
width: 10px;
height: 100
padding-left: 4px;
padding-right: 4px;
}
button {
width: 28px;
font-size: 12px;
margin-right: 1px;
/* background: url(icons/ritm-icon-compress-alt-solid.svg);
background-size: 20px 20px; */
}
</style>
<script type="text/javascript">
function setup(htmlComponent) {
var password = document.getElementById("password");
var toggle = document.getElementById("toggle");
function dataChanged(event) {
password.value = htmlComponent.Data;
}
function valueChanged(event) {
htmlComponent.Data = password.value;
}
function toggleType(event) {
if (password.type === "text")
password.type = "password";
else
password.type = "text";
}
htmlComponent.addEventListener("DataChanged", dataChanged);
password.addEventListener("change", valueChanged);
toggle.addEventListener("click", toggleType);
dataChanged();
valueChanged();
}
</script>
</head>
<body>
<div>
<input id="password" type="password">
<button id="toggle">๐</button>
</div>
</body>
and here's the AppDesigner callback function.
function PasswordHTMLDataChanged(app, event)
password = app.PasswordHTML.Data;
app.pass = password;
end
As part of my troubleshooting I added the disp(password) (uncommented of course) to see if the function was actually triggered and no messages are shown in the logs.