From 391df3ed2dd71090818367ae125369f859c98919 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 30 Apr 2022 16:00:53 +0800 Subject: [PATCH] adjust focus --- src/settings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/settings.ts b/src/settings.ts index 4551fed..3424899 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -645,8 +645,9 @@ const wrapTextWithPasswordHide = (text: TextComponent) => { hider.innerHTML = eyeOff; hider.addEventListener("click", (e) => { const isText = text.inputEl.getAttribute("type") === "text"; - text.inputEl.setAttribute("type", isText ? "password" : "text"); hider.innerHTML = isText ? eyeOff : eye; + text.inputEl.setAttribute("type", isText ? "password" : "text"); + text.inputEl.focus(); }); // the init type of text el is password