Skip to content

fix: send input field missing number pattern validation #4968

Merged
0xmkh merged 4 commits intomainfrom
fix/send-input-pattern
Sep 7, 2025
Merged

fix: send input field missing number pattern validation #4968
0xmkh merged 4 commits intomainfrom
fix/send-input-pattern

Conversation

@0xmkh
Copy link
Copy Markdown
Collaborator

@0xmkh 0xmkh commented Sep 5, 2025

Description

Fixed an issue where the send input field did not include number pattern validation when typing characters

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-2672

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copilot AI review requested due to automatic review settings September 5, 2025 14:56
@linear
Copy link
Copy Markdown

linear bot commented Sep 5, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 5, 2025

🦋 Changeset detected

Latest commit: 5810308

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@reown/appkit-scaffold-ui Patch
pay-test-exchange Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch
@reown/appkit-common Patch
@reown/appkit-controllers Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-polyfills Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-testing Patch
@reown/appkit-ui Patch
@reown/appkit-universal-connector Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

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

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Sep 7, 2025 8:19pm
appkit-demo Ready Ready Preview Comment Sep 7, 2025 8:19pm
appkit-gallery Ready Ready Preview Comment Sep 7, 2025 8:19pm
appkit-laboratory Ready Ready Preview Comment Sep 7, 2025 8:19pm
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Sep 7, 2025 8:19pm
appkit-basic-sign-client-example Ignored Ignored Sep 7, 2025 8:19pm
appkit-basic-up-example Ignored Ignored Sep 7, 2025 8:19pm
appkit-ethers5-bera Ignored Ignored Sep 7, 2025 8:19pm
appkit-nansen-demo Ignored Ignored Sep 7, 2025 8:19pm
appkit-vue-solana Ignored Ignored Sep 7, 2025 8:19pm
appkit-wagmi-cdn-example Ignored Ignored Sep 7, 2025 8:19pm
ethereum-provider-wagmi-example Ignored Ignored Sep 7, 2025 8:19pm
next-wagmi-solana-bitcoin-example Ignored Ignored Sep 7, 2025 8:19pm
vue-wagmi-example Ignored Ignored Sep 7, 2025 8:19pm

@0xmkh 0xmkh changed the title fix: send input field missing number pattern validation when typing characters fix: send input field missing number pattern validation Sep 5, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/scaffold-ui/test/partials/w3m-swap-input.test.ts Outdated
Comment thread packages/scaffold-ui/test/partials/w3m-swap-input.test.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 5, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.34% 34900 / 44547
🔵 Statements 78.34% 34900 / 44547
🔵 Functions 76.1% 3842 / 5048
🔵 Branches 86.63% 8241 / 9512
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/scaffold-ui/src/partials/w3m-swap-input/index.ts 86.53% 90.32% 83.33% 86.53% 87, 92-95, 99-100, 107, 127, 147, 154, 163, 170, 175
Generated in workflow #14883 for commit 5810308 by the Vitest Coverage Report Action

Comment thread packages/scaffold-ui/src/partials/w3m-swap-input/index.ts
Comment thread packages/scaffold-ui/src/partials/w3m-swap-input/index.ts
Comment thread packages/scaffold-ui/src/partials/w3m-swap-input/index.ts
@0xmkh 0xmkh added this pull request to the merge queue Sep 7, 2025
Merged via the queue into main with commit 504fe04 Sep 7, 2025
41 checks passed
@0xmkh 0xmkh deleted the fix/send-input-pattern branch September 7, 2025 21:38
@github-actions github-actions bot mentioned this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants