-
-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ sl-input ] sl-input with toggle-password
set and disabled
or readonly
still allows the password toggle
#745
Comments
In my opinion this is not a bug on a |
@Buni48 imo that’s worth a deeper discussion. iirc, the only real difference between disabled and readonly is that readonly inputs are still focusable whereas disabled inputs aren’t. the assumption of “non-interactive” imo is the same between these states so my thought was that being non-interactive meant that clickable other elements that appear to be “part of the input” shouldn’t be interactive either |
In both |
yeah it’s a tough one. The way I tend to think about it is that the toggle is about double checking what you typed to make sure that you typed the right thing. So if the input is disabled or readonly and you can’t type anything what sense does it make to have a clickable button that allows you to double check what you typed? |
Edge has a built-in password toggle that doesn't show when readonly. But then again, it only shows when you start typing. The case for it showing/working in a readonly input can probably be made. For example, I may want to expose an API key that I've generated so the user can show/hide/copy it from the input. Based on that, I'd be OK with:
Keep in mind the user would be able to opt-out of showing the password toggle by simply removing the attribute. They won't have a way to opt-in if we make that decision for them. |
I also think that this solution makes sense. I've updated the PR. |
Describe the bug
The
toggle-password
button is still operational even when the sl-input isdisabled
orreadonly
which implies that no interaction is available. Imo, the toggle password feature should also be disabled in this case.To Reproduce
Create an sl-input with
toggle-password
anddisabled
The text was updated successfully, but these errors were encountered: