Skip to content

Commit

Permalink
fix(amount input): inconsistent decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
nikarm22 committed Sep 23, 2024
1 parent e17c09a commit cf2ca74
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 104 deletions.
2 changes: 0 additions & 2 deletions wormhole-connect/src/components/InputTransparent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type Props = {
disabled?: boolean;
value?: string | number;
testId?: string;
pattern?: string;
};

const NUMBER_FORMAT_REGEX = /^\d*\.?\d*$/;
Expand Down Expand Up @@ -79,7 +78,6 @@ function InputTransparent(props: Props) {
readOnly={props.disabled}
value={props.value}
data-testid={props.testId}
pattern={props.pattern}
/>
);
}
Expand Down
94 changes: 0 additions & 94 deletions wormhole-connect/src/views/Bridge/Inputs/AmountInput.tsx

This file was deleted.

9 changes: 1 addition & 8 deletions wormhole-connect/src/views/v2/Bridge/AmountInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,12 @@ const AmountInput = (props: Props) => {
e.currentTarget.blur();
},
step: '0.1',
pattern: '[0-9]+([.|,][0-9]{1,2})?',
}}
placeholder="0"
variant="standard"
value={amount}
onChange={handleChange}
onWheel={(e) => {
// IMPORTANT: We need to prevent the scroll behavior on number inputs.
// Otherwise it'll increase/decrease the value when user scrolls on the input control.
// See for details: https://github.com/mui/material-ui/issues/7960
if (e.target instanceof HTMLElement) {
e.target.blur();
}
}}
InputProps={{
disableUnderline: true,
endAdornment: (
Expand Down

0 comments on commit cf2ca74

Please sign in to comment.