mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
#34 removed isLoading from textarea
This commit is contained in:
parent
d7b4fbf535
commit
f45e34f330
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ const LocalCommentForm: FC<IProps> = () => {
|
|||
return (
|
||||
<form onSubmit={formik.handleSubmit}>
|
||||
<FormikProvider value={formik}>
|
||||
<LocalCommentFormTextarea isLoading={formik.isSubmitting} setRef={setTextarea} />
|
||||
<LocalCommentFormTextarea setRef={setTextarea} />
|
||||
{formik.isSubmitting && <div>LOADING</div>}
|
||||
{!!formik.status && <div>error: {formik.status}</div>}
|
||||
<Button size="small" disabled={formik.isSubmitting}>
|
||||
|
|
|
@ -8,8 +8,8 @@ interface IProps {
|
|||
setRef?: (r: HTMLTextAreaElement) => void;
|
||||
}
|
||||
|
||||
const LocalCommentFormTextarea: FC<IProps> = ({ isLoading, setRef }) => {
|
||||
const { values, handleChange, handleSubmit } = useCommentFormContext();
|
||||
const LocalCommentFormTextarea: FC<IProps> = ({ setRef }) => {
|
||||
const { values, handleChange, handleSubmit, isSubmitting } = useCommentFormContext();
|
||||
|
||||
const onKeyDown = useCallback<KeyboardEventHandler<HTMLTextAreaElement>>(
|
||||
({ ctrlKey, key }) => {
|
||||
|
@ -25,7 +25,7 @@ const LocalCommentFormTextarea: FC<IProps> = ({ isLoading, setRef }) => {
|
|||
value={values.text}
|
||||
handler={handleChange('text')}
|
||||
onKeyDown={onKeyDown}
|
||||
disabled={isLoading}
|
||||
disabled={isSubmitting}
|
||||
placeholder={placeholder}
|
||||
minRows={2}
|
||||
setRef={setRef}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue