diff --git a/ui/src/pages/Questions/Detail/components/WriteAnswer/index.tsx b/ui/src/pages/Questions/Detail/components/WriteAnswer/index.tsx index afba9e42..6343f7ef 100644 --- a/ui/src/pages/Questions/Detail/components/WriteAnswer/index.tsx +++ b/ui/src/pages/Questions/Detail/components/WriteAnswer/index.tsx @@ -3,6 +3,7 @@ import { Form, Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { marked } from 'marked'; +import classNames from 'classnames'; import { Editor, Modal } from '@answer/components'; import { postAnswer } from '@answer/api'; @@ -30,6 +31,7 @@ const Index: FC = ({ visible = false, data, callback }) => { }, }); const [showEditor, setShowEditor] = useState(visible); + const [focusType, setForceType] = useState(''); const handleSubmit = () => { if (!formData.content.value) { @@ -92,6 +94,10 @@ const Index: FC = ({ visible = false, data, callback }) => { className="d-none" /> { setFormData({ @@ -102,6 +108,12 @@ const Index: FC = ({ visible = false, data, callback }) => { }, }); }} + onFocus={() => { + setForceType('answer'); + }} + onBlur={() => { + setForceType(''); + }} />