fix: write autofocus code using oncreate lifecycle method instead of doing in html

This commit is contained in:
zelfroster 2023-03-25 08:53:25 +05:30
parent 12e09b3c26
commit e2603ea2b6
2 changed files with 1 additions and 1 deletions

View File

@ -65,6 +65,7 @@ function loginComponent() {
id: 'password',
type: 'password',
placeholder: 'Password',
oncreate: (e) => e.dom.focus(),
onchange: (e) => (passwd = e.target.value),
onkeydown: (e) => {
if (e.keyCode === 13) {

View File

@ -19,7 +19,6 @@
<script type="text/javascript">
function load_ui() {
var main = require('main');
document.getElementById('password').focus();
}
</script>
<noscript>Sorry but JavaScript is needed here! Please enable it in your browser.</noscript>