diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 32e9d026f..71dd98de8 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -45,16 +45,14 @@ export type InfoModalProps = Omit & { } const InfoModal = ({ - isShown, - title, children, onCancel, onSubmit, submitButtonText, - size, + ...baseModalProps }: PropsWithChildren) => { return ( - + {children} onSubmit()}> @@ -65,15 +63,15 @@ const InfoModal = ({ ) } -export type ConfirmModalProps = Omit & { +export type ConfirmModalProps = BaseModalProps & { onConfirm: () => void } -const ConfirmModal = ({ isShown, title, children, onCancel, onConfirm }: PropsWithChildren) => { +const ConfirmModal = ({ children, onCancel, onConfirm, ...baseModalProps }: PropsWithChildren) => { const { t } = useTranslation() return ( - + {children} (name) const form = useFormikContext() + const ref = useRef(null) const [destinationJarPickerShown, setDestinationJarPickerShown] = useState(false) return ( @@ -106,6 +107,7 @@ export const DestinationInputField = ({ className={styles.button} onClick={() => { form.setFieldValue(field.name, form.initialValues[field.name], true) + setTimeout(() => ref.current?.focus(), 4) }} disabled={disabled} > @@ -118,6 +120,7 @@ export const DestinationInputField = ({
setShowConfirmSendModal(undefined)} diff --git a/src/components/fb/SpendFidelityBondModal.tsx b/src/components/fb/SpendFidelityBondModal.tsx index d4228e233..741cebc8e 100644 --- a/src/components/fb/SpendFidelityBondModal.tsx +++ b/src/components/fb/SpendFidelityBondModal.tsx @@ -391,6 +391,7 @@ const SpendFidelityBondModal = ({ {showConfirmSendModal && fidelityBond && selectedDestinationJarIndex !== undefined && ( {