-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiFieldPassword] Support toggling of obfuscation #3751
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3751/ |
Currently just waiting on #3749 |
- Added props `type` and `canToggleVisibility`
8baa109
to
5e64ef3
Compare
…tagrid example Unnecessary to have a custom z-index as the default is much higher than the supplied one.
Preview documentation changes for this PR: https://eui.elastic.co/pr_3751/ |
Dependency merged, opening this up for review. |
@myasonik Adding you as a reviewer, but always as optional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked good to me with a quick pass just with keyboard and VO+ChromiEdge. Didn't go deep on it though.
Will ask that someone proof this in Windows though! I'm like 80% certain that Windows adds its own reveal button to password fields so I'd be curious to see how these interact.
Hrrmph. I'll do a little research. |
The only thing I could find was this. https://developer.mozilla.org/en-US/docs/Archive/Web/CSS/::-ms-reveal And that box makes me side-eye implementing it... |
🤦 I'm having a foggy-brain day... I thought it existed because I saw it moments ago on ChromiEdge. And I just verified it the same on my Windows machine. Can we hide the browser one with |
I could, just a bit wary of actually using it based on the link I mentioned above and the big ole warning box wrapped around the whole thing |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3751/ |
That warning box is something else. I use MDN docs all the time and have never seen that style 😄
This, however, makes me think there may not be any severe effects for our case as we're not relying on it for anything beyond a visual experience. Worst case is that a user sees both. Not great, but it doesn't seem dangerous. Thoughts? |
Yeah I think so long as we're not relying on it for every user, and I'll only remove it if we're providing the custom one. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3751/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I formalized the multiple ref thing you had. There's another open PR with the same pattern, so I made a hook for it: cchaos#35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make an issue? |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3751/ |
That's good to know. Thanks for fixing locally |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3751/ |
Fixes #3153
Based on guidance mentioned in the issue and this reference, the easiest way to support is with a button icon that changes the input
type
frompassword
totext
.Therefore, this PR simply adds a new prop called
type: 'password' | 'text' | 'dual'
. The default being 'password.'The 'text' option is simply there to allow consumers to handle the text masking manually from outside of the component. The 'dual' option adds an EuiButtonIcon with eye/eyeClosed icons to the
append
of the form layout which simply toggles the type from 'password' to 'text'.Checklist