Skip to content

fix: Normalize x-input number filtering#2193

Merged
PupilTong merged 5 commits intomainfrom
copilot/fix-input-type-attribute
Feb 5, 2026
Merged

fix: Normalize x-input number filtering#2193
PupilTong merged 5 commits intomainfrom
copilot/fix-input-type-attribute

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 4, 2026

x-input number handling now keeps the inner input as text with inputmode="decimal" while filtering invalid characters internally. This supports values like 1.2 and strips invalid input like 1.2a without setting the input-filter attribute.

Changes Made

  • Apply internal numeric filtering for type="number" without setting input-filter.
  • Keep the inner input type as text and preserve inputmode="decimal".
  • Added a dedicated fixture for attribute-type-number-inner-input-type.
  • Updated the numeric input test to validate 1.2a filters to 1.2.
  • Added a patch changeset for @lynx-js/web-elements.

Testing

  • Not run (not requested in this update).

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: 05b982d

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

This PR includes changesets to release 2 packages
Name Type
@lynx-js/web-elements Patch
@lynx-js/web-core-wasm 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

Copilot AI changed the title [WIP] Fix type attribute of inner input element in x-input Propagate x-input number type to inner input Feb 4, 2026
Copilot AI requested a review from PupilTong February 4, 2026 04:31
@PupilTong
Copy link
Copy Markdown
Collaborator

@copilot you should add a new html file for test attribute-type-number-inner-input-type, check packages/web-platform/web-elements/tests/fixtures/x-input/attribute-type-number.html

@PupilTong
Copy link
Copy Markdown
Collaborator

@copilot you should add a new html file for test attribute-type-number-inner-input-type, check packages/web-platform/web-elements/tests/fixtures/x-input/attribute-type-number.html
submit the new attribute-type-number-inner-input-type.html

@PupilTong PupilTong marked this pull request as ready for review February 4, 2026 06:17
@PupilTong PupilTong requested a review from Sherry-hue as a code owner February 4, 2026 06:17
@PupilTong PupilTong changed the title Propagate x-input number type to inner input fix: Propagate x-input number type to inner input Feb 4, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 4, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Comment @coderabbitai help to get the list of available commands and usage tips.

@PupilTong
Copy link
Copy Markdown
Collaborator

@copilot add a patch changeset

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 4, 2026

Merging this PR will degrade performance by 5.67%

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 61 untouched benchmarks
⏩ 3 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-div-10000 460 ms 487.7 ms -5.67%
basic-performance-small-css 8.2 ms 7.6 ms +7.89%

Comparing copilot/fix-input-type-attribute (05b982d) with main (4240138)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot add a patch changeset

Added a patch changeset in commit e345f71. No UI changes were required, so no screenshot is available.

Copilot AI and others added 3 commits February 4, 2026 16:19
Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
@PupilTong PupilTong force-pushed the copilot/fix-input-type-attribute branch from e345f71 to 72245ac Compare February 4, 2026 08:19
@relativeci
Copy link
Copy Markdown

relativeci bot commented Feb 4, 2026

Web Explorer

#7537 Bundle Size — 383.67KiB (~+0.01%).

72245ac(current) vs 4240138 main#7535(baseline)

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#7537
     Baseline
#7535
Regression  Initial JS 154.83KiB(~+0.01%) 154.82KiB
No change  Initial CSS 35.05KiB 35.05KiB
Change  Cache Invalidation 40.35% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 239(+0.84%) 237
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.99% 2.99%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#7537
     Baseline
#7535
Regression  JS 252.77KiB (~+0.01%) 252.76KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.05KiB 35.05KiB

Bundle analysis reportBranch copilot/fix-input-type-attributeProject dashboard


Generated by RelativeCIDocumentationReport issue

@PupilTong
Copy link
Copy Markdown
Collaborator

@copilot it doesn't work. We are supposed to support number like 1.2, but 1.2a is not allowed. try to fix it with another way

Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot it doesn't work. We are supposed to support number like 1.2, but 1.2a is not allowed. try to fix it with another way

Updated number handling to keep the inner input as text with inputmode="decimal" and an input-filter regex that strips invalid characters while allowing a single dot. Commit: edf2f9c. No UI changes, so no screenshot is available.

Copilot AI changed the title fix: Propagate x-input number type to inner input fix: Normalize x-input number filtering Feb 4, 2026
@PupilTong
Copy link
Copy Markdown
Collaborator

@copilot The input-filter should not be set explicitly. you should make all the feature consider in unique

Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot The input-filter should not be set explicitly. you should make all the feature consider in unique

Updated number filtering to be internal (no explicit input-filter attribute) and added a test that typing "1.2a" yields "1.2". Commit: 05b982d. No UI changes, so no screenshot is available.

@PupilTong PupilTong merged commit d924b6a into main Feb 5, 2026
72 of 75 checks passed
@PupilTong PupilTong deleted the copilot/fix-input-type-attribute branch February 5, 2026 06:10
colinaaa pushed a commit that referenced this pull request Feb 23, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/motion@0.0.3

### Patch Changes

- Fix an issue that motion/mini will accidentally imports full version,
causing compiling error
([#2204](#2204))

## @lynx-js/react@0.116.3

### Patch Changes

- fix: remove `lynx.createSelectorQuery` deprecated warning in
production
([#2195](#2195))

- Add a DEV-only guard that detects MainThread flush loops caused by
re-entrant MTS handlers.
([#2159](#2159))

This typically happens when a MainThread handler (e.g. event callback or
`MainThreadRef`) performs UI mutations (like `Element.setStyleProperty`,
`setStyleProperties`, `setAttribute`, or `invoke`) that synchronously
trigger a flush which re-enters the handler again.

- Avoid DEV_ONLY_SetSnapshotEntryName on standalone lazy bundle.
([#2184](#2184))

- Add alog and trace for BTS event handlers.
([#2102](#2102))

- fix: Main thread functions cannot access properties on `this` before
hydration completes.
([#2194](#2194))

    This fixes the `cannot convert to object` error.

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

- fix: captured variables in main thread functions within class
components do not update correctly
([#2197](#2197))

## @lynx-js/rspeedy@0.13.4

### Patch Changes

- Bump ts-blank-space v0.7.0
([#2238](#2238))

- Bump Rsbuild v1.7.3 with Rspack v1.7.5.
([#2189](#2189))

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.8

## @lynx-js/qrcode-rsbuild-plugin@0.4.5

### Patch Changes

- Only register console shortcuts when running in TTY environments
([#2202](#2202))

## @lynx-js/react-rsbuild-plugin@0.12.8

### Patch Changes

- Updated dependencies
\[[`4240138`](4240138)]:
    -   @lynx-js/react-webpack-plugin@0.7.4
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.8
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4
    -   @lynx-js/template-webpack-plugin@0.10.3

## @lynx-js/testing-environment@0.1.11

### Patch Changes

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

## @lynx-js/web-constants@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/web-core@0.19.8

### Patch Changes

- fix: avoid error when LynxView is removed immediately after connected
([#2182](#2182))

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8
    -   @lynx-js/web-mainthread-apis@0.19.8
    -   @lynx-js/web-worker-rpc@0.19.8
    -   @lynx-js/web-worker-runtime@0.19.8

## @lynx-js/web-core-wasm@0.0.3

### Patch Changes

- Updated dependencies
\[[`e0972ef`](e0972ef),
[`3bc017e`](3bc017e),
[`e2d349e`](e2d349e),
[`d924b6a`](d924b6a)]:
    -   @lynx-js/web-elements@0.11.2
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/web-elements@0.11.2

### Patch Changes

- Add scrollHeight/scrollWidth getters to XList.
([#2156](#2156))

- Inherit padding styles for x-input elements.
([#2199](#2199))

- Remove the default lazy-loading attribute from x-image elements.
([#2186](#2186))

- Fix x-input number type forwarding to the inner input element.
([#2193](#2193))

## @lynx-js/web-mainthread-apis@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8

## @lynx-js/web-worker-runtime@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8
    -   @lynx-js/web-mainthread-apis@0.19.8
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/react-webpack-plugin@0.7.4

### Patch Changes

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

## create-rspeedy@0.13.4



## @lynx-js/react-alias-rsbuild-plugin@0.12.8



## upgrade-rspeedy@0.13.4



## @lynx-js/web-core-server@0.19.8



## @lynx-js/web-rsbuild-server-middleware@0.19.8



## @lynx-js/web-worker-rpc@0.19.8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants