-
Notifications
You must be signed in to change notification settings - Fork 39
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
API Key Field Enhancement: Replaced Show/Hide button with Eye ReactIcons #579
Conversation
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.
@rjwignar Looks pretty good.
I was wondering maybe we should also set a title to this button saying "Show" or "Hide" based on its state.
If we don't want a visual indication, it should at least have an aria-label
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.
Just tested this. Works great!
And I think we should probably be using an <IconButton
variant={"ghost"}
size={buttonSize}
icon={show ? <IoMdEyeOff /> : <IoMdEye />}
onClick={() => setShow(!show)}
aria-label={show ? "Hide" : "Show"} // This is not needed if we are providing a title, but the linter screams if we don't have this on an IconButton
title={show ? "Hide" : "Show"}
/> |
Deploying chatcraft-org with Cloudflare Pages
|
Thanks for your suggestions, @Amnish04. I recently committed them to this PR. I kept the aria-label for accessibility reasons. |
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.
@rjwignar Thanks for the changes. Looks good now!
This fixes #552
As a followup to #530,
I replaced the Show/Hide Button with the IoMdEye/IoMdEyeOff react icons:
I modelled the behaviour based on what I observed on Facebook Messenger (show 'Eye On' when text is obscured, show 'Eye Off' when text is visible: