fix(input): stop mouse wheel from changing number input values - #5
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Comment |
Add optional input.js helper that blurs a focused .input[type="number"] on wheel so scrolling no longer mutates the value while the page still scrolls. Uses delegated, auto-initializing listener and documents usage. Co-authored-by: Cursor <cursoragent@cursor.com>
Assert the browser default still mutates values, and that input.js keeps the value stable for static and dynamically added fields. Co-authored-by: Cursor <cursoragent@cursor.com>
a09c4ce to
b54e307
Compare
|
Rebased onto current
|
Summary
components/input/input.jshelper that fixes the default browser behavior where scrolling the mouse wheel over a focused<input type="number">increments/decrements its value.wheel, so the value stays put and the page keeps scrolling normally (nopreventDefault).documentand auto-initializes, so it covers both existing and dynamically added.input[type="number"]fields without re-init. Exposed as a default export, a named export, andwindow.preventNumberInputScroll, and returns a cleanup function for scoped/manual use.Docs & wiring
components/input/test.html: loads the module and notes the behavior on the numeric field for live verification.components/input/README.md: new "Scroll-to-Change Fix (JavaScript)" section + dependency note.AGENTS.md: Input section usage, JS imports list, key principles, version info, and file tree.llms.txt: Input entry + file structure.Test plan
components/input/test.html, focus a numeric input, and scroll the mouse wheel — value should not change and the page should scroll..input[type="number"]fields are also covered.Made with Cursor