Allow editing transaction amount after clicking max (#8475)#10278
Allow editing transaction amount after clicking max (#8475)#10278Gudahtt merged 1 commit intoMetaMask:developfrom
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
I have read the CLA Document and I hereby sign the CLA |
Gudahtt
left a comment
There was a problem hiding this comment.
Thanks for the contribution! There are a couple of tasks left to finishing this:
-
The prop
maxModeOnis still being passed intocurrency-input.componentfromcurrency-input.contiainer. Could you removed this unusued prop from the container component? -
Max mode remains toggled after the user edits the gas amount, which doesn't seem ideal. Ideally max mode would toggle when the user edited the gas amount, so that the user could click "Max" again and go back to the maximum amount. This is probably easiest to accomplish by editing this change handler.
Additionally, the CLA bot requires you to state that you agree to the CLA by making a comment with just that phrase. That last attempt didn't work because you included a quote of the CLA bot comment.
|
Thanks for your feedback @Gudahtt! Regarding this piece:
I'm completely new to this codebase so I could very well be missing something but won't the AdvancedGasInputs need to toggle off maxMode in their change handler(s) to produce the desired behavior you describe? Thanks! |
|
I have read the CLA Document and I hereby sign the CLA |
I was thinking of the amount field, not the gas fields. That's an interesting point though 🤔 Maybe it should toggle when gas is edited as well? I think we should leave it for now so that it matches the behaviour of the token send, but that's something worth considering in the upcoming confirmation screen redesign. But about that request to update the change handler - sorry, you can disregard it completely! I just realized that So all that's left now is to get rid of the unused prop. |
131d4bc to
1d3b433
Compare
1d3b433 to
572fc3b
Compare
|
Almost there! The e2e tests can be tricky to debug, so I looked into this one. The last test failure is caused by an assertion in our e2e tests that (for some reason) ensures the input element is disabled. That line should be removed. From line 311 of |
|
Ah thanks @Gudahtt! Will do! |
572fc3b to
a1a0747
Compare
Gudahtt
left a comment
There was a problem hiding this comment.
LGTM, great work! I've tested this, and it appears that this now works the same for ETH sends as it already did for token transfers. The amount can be freely edited after clicking max.
Fixes: #8475
Explanation: Removes maxModeOn prop from UnitInput component which when true disabled the input. Per request on issue #8475, removing the maxModeOn flag allows users to edit currency input when transaction max button is selected.
Manual testing steps: