creativetimofficial / ct-impact-design-system-pro

Impact Design System PRO
https://demos.creative-tim.com/impact-design-system-pro/
3 stars 2 forks source link

Sign in/up eye icon does not trigger show/hide of password #2

Closed zoltanszogyenyi closed 4 years ago

zoltanszogyenyi commented 4 years ago

Version

1.0

Reproduction link

https://demos.creative-tim.com/impact-design-system-pro/front/pages/sign-in.html

Operating System

Mac OS

Device

Macbook Pro

Browser & Version

Chrome

Steps to reproduce

  1. Click on eye icon
  2. See nothing happen

    What is expected?

    The eye icon should trigger the password field.

    What is actually happening?

    I have an issue with the password unhide in the Signin and Signup forms. When the user click on the eye icon its not showing up the hidden password.


Solution

Fix it.

Additional comments

zoltanszogyenyi commented 4 years ago

We will have this fixed in version 1.1. Until then you can do the following to remedy the situation:

  1. Add the following styles to src/front/scss/front/components/_forms.scss:
.form-control[type="text"] + .input-group-append,
.form-control[type="password"] + .input-group-append {
    &:hover {
        cursor: pointer;
    }
}
  1. Add the following snippet in src/front/assets/js/front.js:
var $passwordToggle = $('.form-control[type="password"] + .input-group-append');
    var $passwordInput = $('.form-control[type="password"]');
    $passwordToggle.click(function() {
     if ($passwordInput.attr('type') === 'password' ) {
         $passwordInput.attr('type', 'text');
     } else {
         $passwordInput.attr('type', 'password');
     }
});
vakasapu commented 4 years ago

Thanks, this is working now

zoltanszogyenyi commented 4 years ago

This has been fixed in v1.1.0.