Skip to content
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

fix: Support decimal point on advanced gas modal on mac #28869

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Dec 3, 2024

Description

The main bug this PR fixes only happens on mac, not linux. It is the following: when a user pressed . on the advanced gas modal and a number after it, a zero would appear instead the . and any numbers before it. This is because in the onChange in NumericInput, when the user presses ., e.target.value is "", and the code was defaulting the value that got passed to the on change handler to 0. To fix the bug, this PR removes that default, and necessarily the parseInt that wrapped it.

The PR also adds the 0 default to a few places where the newly possible "" value would otherwise break execution.

This PR also prevents the user from setting decimal custom nonce values.

Finally, it prevents , to be registered when allowDecimals is set on <FormField />, most notably for the gas limit input.

Open in GitHub Codespaces

Related issues

Fixes: #28843

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Dec 3, 2024
@pedronfigueiredo pedronfigueiredo self-assigned this Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

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.

@metamaskbot
Copy link
Collaborator

Builds ready [6ac6ef2]
Page Load Metrics (1706 ± 33 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1613182517116330
domContentLoaded1583180016826933
load1589182617066933
domInteractive246631115
backgroundConnect94622136
firstReactRender14261732
getState82130110126
initialActions00000
loadScripts1206138013005828
setupStore68710
uiStartup1789213119379043
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -9 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/28843 branch 3 times, most recently from cc6bafa to fca6491 Compare December 6, 2024 10:59
@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review December 6, 2024 11:08
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner December 6, 2024 11:08
@metamaskbot
Copy link
Collaborator

Builds ready [ddf4e7b]
Page Load Metrics (2021 ± 82 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30222991870497239
domContentLoaded17242259199516579
load17292294202117082
domInteractive26104462110
backgroundConnect877242110
firstReactRender169323168
getState1003631485526
initialActions00000
loadScripts12971790154615072
setupStore77312147
uiStartup19762833237520699
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 35 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pedronfigueiredo pedronfigueiredo added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit 44696fd Dec 9, 2024
78 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/28843 branch December 9, 2024 11:03
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2024
@metamaskbot metamaskbot added the release-12.10.0 Issue or pull request that will be included in release 12.10.0 label Dec 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.10.0 Issue or pull request that will be included in release 12.10.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Gas controls to edit Max base fee and Priority Fee do not support decimal point on mac
4 participants