You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PLAY-1720] Phone Number Input formatAsYouType Prop (#4125)
**What does this PR do?**
- Add `formatAsYouType`/`format_as_you_type` prop to Phone Number Input
kit
- Keep most of Phone Number Input logic the same if this prop is false
- Replace `telInputInit` state, `itiInit`, with a ref, `itiRef`, so it's
available across renders
- In React, remove formatting (dashes, spaces, parentheses) in the
`number` prop in the onChange event
- Make docs and tests
**Screenshots:**

**How to test?** Steps to confirm the desired behavior:
1. Go to /kits/phone_number_input/react#format-as-you-type
2. Type numbers and note that it formats
3. Check other doc examples
4. Review Rails versions
#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [x] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
- [x] **TESTS** I have added test coverage to my code.
NOTE: the `number` in the React `onChange` event will not include formatting (no spaces, dashes, and parentheses). For Rails, the `value` will include formatting and its value must be sanitized manually.
0 commit comments