Page MenuHomePhabricator

[Cashtab] Disabled scroll wheel within input fields
ClosedPublic

Authored by kieran709 on Nov 1 2022, 16:08.

Details

Summary

Related to T2744. Removed ability to scroll within amount input fields in SendBch, Burn eToken amount input and Send eToken amount input. I think this is a welcome change and should be implemented.

Test Plan

cd web/cashtab && npm start
navigate to Send screen
click on the 'Amount' input and scroll
observe that the input loses focus

navigate to send eToken screen
click on the 'Amount' input and scroll
observe that the input loses focus

on the same screen, click on the 'Burn eToken' input and scroll
observe that the input loses focus

Diff Detail

Repository
rABC Bitcoin ABC
Branch
disable-scrolling-within-input-fields
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20790
Build 41242: Build Diffcashtab-tests
Build 41241: arc lint + arc unit

Event Timeline

bytesofman requested changes to this revision.Nov 1 2022, 16:25

Because the intention here is to implement this across the entire app -- this onWheel prop should be added to the component where it is defined, i.e. in EnhancedInputs.js (unless it is not possible / practical to do so, in this case need some discussion in the diff about why)

This revision now requires changes to proceed.Nov 1 2022, 16:25

Responding to review feedback.

bytesofman requested changes to this revision.Nov 1 2022, 18:32
bytesofman added inline comments.
web/cashtab/src/components/Common/EnhancedInputs.js
253

Please add a comment in the codebase above this component explaning why event.target.blur() is used here

web/cashtab/src/components/Send/SendToken.js
536

Could this not be patched in EnhancedInputs.js ?

This revision now requires changes to proceed.Nov 1 2022, 18:32

Responding to review feedback, removed onWheel from inputProps in SendToken.js which was left in by mistake in last push, added comments to explain why target.blur() is used in this case instead of event.preventDefault().

This revision is now accepted and ready to land.Nov 1 2022, 22:23