-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent mouse wheel from changing input on add liquidity step #3930
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
WalkthroughThe changes in this pull request modify the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/web/components/input/input-box.tsx (1)
Line range hint
143-147
: LGTM with a minor suggestion: Consider extracting the wheel handlerThe implementation correctly prevents scroll wheel input and properly manages focus state. However, since the wheel handler is identical for both input types, consider extracting it to reduce duplication.
Consider extracting the wheel handler to a constant:
+ const handleWheel = (e: WheelEvent) => (e.target as HTMLInputElement).blur(); return ( // ... <AutosizeInput - onWheel={(e) => (e.target as HTMLInputElement).blur()} + onWheel={handleWheel} // ... /> <input - onWheel={(e) => (e.target as HTMLInputElement).blur()} + onWheel={handleWheel} // ... />🧰 Tools
🪛 Biome
[error] 146-146: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/web/components/input/input-box.tsx
(2 hunks)
🔇 Additional comments (2)
packages/web/components/input/input-box.tsx (2)
120-120
: LGTM: Wheel event handler for AutosizeInput
The implementation effectively prevents scroll wheel from modifying the input value by blurring the field when a wheel event occurs.
120-120
: Implementation successfully addresses PR objective
The changes effectively prevent mouse wheel from modifying input values by:
- Adding wheel event handlers to both input types
- Using field blur to prevent value changes
- Maintaining proper focus state management
This implementation successfully addresses the issue described in FE-1187.
Also applies to: 143-147
What is the purpose of the change:
We want to prevent the liquidity input from changing when user uses the mouse scroll
Linear Task
https://linear.app/osmosis/issue/FE-1187/disable-mouse-scroll-wheel-for-liquidity-amount-input
Brief Changelog
Testing and Verifying
This change has been tested locally by rebuilding the website and verified content and links are expected