-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: input mask #2538
feat: input mask #2538
Conversation
whoops, I overlooked an ANDI warning we might want investigate I'm seeing it suggest using |
It already has a label though (associated with |
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.
Lemme know if you have any questions about this feedback!
@gidjin once this is merged, could we please do a minor release to make this available for my current client? |
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.
Approving as not to block.
However, I would like to see a reorg (can be a follow on PR if releasing this is priority), where the folder structure looks like:
src/
components/
forms/
TextInput/
{...all our existing stuff}
TextInputMask/
TextInputMask.tsx
TextInputMask.test.tsx
TextInputMask.stories.tsx
Basically just to make sure that the tests and storybook examples are also separated out
Edit: reversing course, noted a few small things that I think are actually functionally important
className="usa-input-mask--content" | ||
aria-hidden | ||
data-testid={`${id}Mask`}> | ||
<i>{iValue}</i> |
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'll reiterate that if you want the <i>
tag to not show up until something has been typed (like the USDWS examples) you can do this
<i>{iValue}</i> | |
{iValue && <i>{iValue}</i>} |
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.
yup, but i didn't see any reason to 🤷
Summary
Adds input masks to text inputs
Related Issues or PRs
Resolves #2517
How To Test
Open the last story for Text input: Input Mask
Screenshots (optional)
This is me just pianoing 1-9, showing that it autoformats: