1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Refocus credential typedInput when hide/show button clicked

This commit is contained in:
Nick O'Leary 2020-02-10 11:16:19 +00:00
parent 33cbb2ada8
commit bffcaa1c17
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -188,9 +188,15 @@
if (currentType === "text") { if (currentType === "text") {
that.input.attr("type","password"); that.input.attr("type","password");
eyeCon.removeClass("fa-eye-slash").addClass("fa-eye"); eyeCon.removeClass("fa-eye-slash").addClass("fa-eye");
setTimeout(function() {
that.input.focus();
},50);
} else { } else {
that.input.attr("type","text"); that.input.attr("type","text");
eyeCon.removeClass("fa-eye").addClass("fa-eye-slash"); eyeCon.removeClass("fa-eye").addClass("fa-eye-slash");
setTimeout(function() {
that.input.focus();
},50);
} }
}).hide(); }).hide();
var eyeCon = $('<i class="fa fa-eye"></i>').css("margin-left","-1px").appendTo(eyeButton); var eyeCon = $('<i class="fa fa-eye"></i>').css("margin-left","-1px").appendTo(eyeButton);