feat: crypto dropdown should stay open when editing commissions
This commit is contained in:
parent
bee2dc42e6
commit
7af8079a2a
3 changed files with 8 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ const Autocomplete = ({
|
|||
multiple,
|
||||
onChange,
|
||||
labelProp,
|
||||
shouldStayOpen,
|
||||
value: outsideValue,
|
||||
error,
|
||||
fullWidth,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ const AutocompleteFormik = ({ options, onChange, ...props }) => {
|
|||
}
|
||||
|
||||
const onChangeHandler = value => setFieldValue(name, value)
|
||||
const shouldStayOpen = !!props.shouldStayOpen
|
||||
|
||||
return (
|
||||
<Autocomplete
|
||||
|
|
@ -38,7 +39,10 @@ const AutocompleteFormik = ({ options, onChange, ...props }) => {
|
|||
if (!props.multiple) return setOpen(true)
|
||||
setOpen(value?.length !== props.limit)
|
||||
}}
|
||||
onClose={() => setOpen(false)}
|
||||
onClose={(event, reason) => {
|
||||
if (shouldStayOpen && reason !== 'blur') setOpen(true)
|
||||
else setOpen(false)
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ const getOverridesFields = (getData, currency, auxElements) => {
|
|||
valueProp: 'code',
|
||||
labelProp: 'display',
|
||||
multiple: true,
|
||||
onChange: onCryptoChange
|
||||
onChange: onCryptoChange,
|
||||
shouldStayOpen: true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue