Skip to content

Commit

Permalink
farrah/ fixed sell form validation (#6047)
Browse files Browse the repository at this point in the history
* fixed sell form validation

* fixed buy/sell form validations

* reset amount with empty field
  • Loading branch information
farrah-deriv committed Jul 28, 2022
1 parent 4dcf967 commit 543bd43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/p2p/src/components/buy-sell/buy-sell-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ const BuySellForm = props => {
validate={buy_sell_store.validatePopup}
validateOnMount={!should_disable_field}
initialValues={{
amount: input_amount,
amount: min_order_amount_limit,
contact_info: buy_sell_store.contact_info,
payment_info: buy_sell_store.payment_info,
rate: rate_type === ad_type.FLOAT ? effective_rate : null,
}}
initialErrors={buy_sell_store.is_sell_advert ? { contact_info: true } : {}}
onSubmit={(...args) => buy_sell_store.handleSubmit(() => isMounted(), ...args)}
>
{({ errors, isSubmitting, isValid, setFieldValue, submitForm, touched, values }) => {
{({ errors, isSubmitting, isValid, setFieldValue, submitForm, touched }) => {
buy_sell_store.form_props.setIsSubmitDisabled(
!isValid ||
isSubmitting ||
Expand Down Expand Up @@ -379,7 +379,7 @@ const BuySellForm = props => {
onChange={event => {
if (event.target.value === '') {
setFieldValue('amount', '');
setInputAmount(0);
setInputAmount('');
} else {
const amount = getRoundedNumber(
event.target.value,
Expand All @@ -390,7 +390,7 @@ const BuySellForm = props => {
}
}}
required
value={values.amount}
value={input_amount}
disabled={should_disable_field}
/>
)}
Expand Down

1 comment on commit 543bd43

@vercel
Copy link

@vercel vercel bot commented on 543bd43 Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
deriv-app.binary.sx
deriv-app-git-master.binary.sx
binary.sx

Please sign in to comment.