From aa8f5ef4e9b9b604d77355d1ae438e9e5207c0b7 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Mon, 13 May 2019 00:05:39 -0400 Subject: [PATCH] Fix input autofocus under Vue.js v2.6 --- server/src/main/resources/static/client.js | 3 +++ server/src/main/resources/static/index.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/resources/static/client.js b/server/src/main/resources/static/client.js index e92bd51..632c93c 100644 --- a/server/src/main/resources/static/client.js +++ b/server/src/main/resources/static/client.js @@ -257,6 +257,9 @@ var vm = new Vue({ this.opponentScore = 0; } } + }, + mounted: function() { + document.getElementById('nicknameInput').focus(); } }); diff --git a/server/src/main/resources/static/index.html b/server/src/main/resources/static/index.html index 79a9c41..d5d9098 100644 --- a/server/src/main/resources/static/index.html +++ b/server/src/main/resources/static/index.html @@ -15,7 +15,7 @@

What is your name?

- +

{{ usernameError }}