diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-09-07 09:59:35 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-09-07 09:59:35 +1000 |
| commit | 17b6539796f0ed4ce23da2e88d0f520959908606 (patch) | |
| tree | 834896fa2d40c8c278d438ed7e34b33e096399d0 /wwwroot | |
| parent | 85e718f94d4dd9ed539de82971710f117566b740 (diff) | |
Implemented a slightly better fix for focusing input dialogs
Diffstat (limited to 'wwwroot')
| -rw-r--r-- | wwwroot/js/dialog.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wwwroot/js/dialog.js b/wwwroot/js/dialog.js index 7ea141e..065014a 100644 --- a/wwwroot/js/dialog.js +++ b/wwwroot/js/dialog.js @@ -41,6 +41,11 @@ function setDialogVisibility(element, visible) { element.style.opacity = 1; element.style.visibility = 'visible'; bumpDialog(element); + + var input = element.querySelector('input[type="text"]'); + if(input) { + setTimeout(() => input.focus(), 100); + } } else { element.style.opacity = 0; element.style.visibility = 'hidden'; |
