adjust focus

This commit is contained in:
fyears 2022-04-30 16:00:53 +08:00
parent c542789c93
commit 391df3ed2d

View File

@ -645,8 +645,9 @@ const wrapTextWithPasswordHide = (text: TextComponent) => {
hider.innerHTML = eyeOff; hider.innerHTML = eyeOff;
hider.addEventListener("click", (e) => { hider.addEventListener("click", (e) => {
const isText = text.inputEl.getAttribute("type") === "text"; const isText = text.inputEl.getAttribute("type") === "text";
text.inputEl.setAttribute("type", isText ? "password" : "text");
hider.innerHTML = isText ? eyeOff : eye; hider.innerHTML = isText ? eyeOff : eye;
text.inputEl.setAttribute("type", isText ? "password" : "text");
text.inputEl.focus();
}); });
// the init type of text el is password // the init type of text el is password