-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
docs: add example password Input with show/hide togle #753
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4a3677b:
|
Deploy preview for reakit ready! Built with commit 4a3677b |
Thanks, @mattrothenberg! That's cool! ❤️ I guess Tailwind CDN is "okay". If it gets more commonly used across examples we can look into adding that directly to the Storybook config and reduce the Storybook bundle size. Could you please add some tests? |
Codecov Report
@@ Coverage Diff @@
## master #753 +/- ##
==========================================
+ Coverage 95.63% 95.67% +0.03%
==========================================
Files 185 188 +3
Lines 2976 2980 +4
Branches 794 793 -1
==========================================
+ Hits 2846 2851 +5
+ Misses 130 129 -1
Continue to review full report at Codecov.
|
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.
Thanks for working on this @mattrothenberg!
I've added the example folder that was missing and refactored the tests.
I'll go ahead and merge it, but I'd appreciate a review on my changes.
|
||
const handleToggle = () => { | ||
setInputType((prevInputType) => | ||
prevInputType === "password" ? "text" : "password" |
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.
Much better change, good idea!
Adds a Storybook example from the conversation in #626 and #664.
Screenshots
I know requiring Tailwind via CDN isn't ideal, but it was the path of least resistance to getting this example together. I'm happy to add a test, too, if that's required for all examples!