fix: send input field missing number pattern validation #4968
Conversation
🦋 Changeset detectedLatest commit: 5810308 The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the swap input field lacked proper number pattern validation when users typed characters. The fix prevents non-numeric characters from being entered by adding HTML pattern validation and implementing proper input filtering logic.
- Added HTML pattern attribute to restrict input to numbers, dots, and commas
- Implemented input filtering to automatically remove non-numeric characters as users type
- Enhanced test coverage for dot-as-first-character handling and non-numeric character filtering
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/scaffold-ui/src/partials/w3m-swap-input/index.ts | Added pattern="[0-9,.]*" attribute to input element for HTML validation |
| packages/scaffold-ui/test/partials/w3m-swap-input.test.ts | Added comprehensive tests for dot handling and non-numeric character filtering |
| .changeset/some-keys-behave.md | Added changeset documentation for the bug fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Description
Fixed an issue where the send input field did not include number pattern validation when typing characters
Type of change
Associated Issues
For Linear issues: Closes APKT-2672
Checklist