diff --git a/v2/examples/customlayout/myfrontend/src/main.js b/v2/examples/customlayout/myfrontend/src/main.js index 4ad5a2cae..6cb4ad78d 100644 --- a/v2/examples/customlayout/myfrontend/src/main.js +++ b/v2/examples/customlayout/myfrontend/src/main.js @@ -2,7 +2,7 @@ import './style.css'; import './app.css'; import logo from './assets/images/logo-universal.png'; -import {Greet} from '../wailsjs/go/main/App'; +import { Greet } from '../wailsjs/go/main/App'; document.querySelector('#app').innerHTML = ` @@ -14,6 +14,11 @@ document.querySelector('#app').innerHTML = ` `; document.getElementById('logo').src = logo; +document.addEventListener("keydown", (e) => { + if (e.code === "Enter") { + window.greet(); + } +}); let nameElement = document.getElementById("name"); nameElement.focus();