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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #36109)

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 ↗(On Diff #36109)

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