mirror of https://gitee.com/answerdev/answer.git
fix: create new tag set default value
This commit is contained in:
parent
e6a3bb0ed7
commit
3f6253e3c2
|
@ -253,7 +253,7 @@ const TagSelector: FC<IProps> = ({
|
|||
variant="link"
|
||||
className="px-3 btn-no-border w-100 text-start"
|
||||
onClick={() => {
|
||||
tagModal.onShow();
|
||||
tagModal.onShow(tag);
|
||||
}}>
|
||||
+ {t('create_btn')}
|
||||
</Button>
|
||||
|
|
|
@ -39,8 +39,21 @@ const useTagModal = (props: IProps = {}) => {
|
|||
setVisibleState(false);
|
||||
};
|
||||
|
||||
const onShow = () => {
|
||||
const onShow = (searchStr = '') => {
|
||||
setVisibleState(true);
|
||||
setFormData({
|
||||
...formData,
|
||||
displayName: {
|
||||
value: searchStr,
|
||||
isInvalid: false,
|
||||
errorMsg: '',
|
||||
},
|
||||
slugName: {
|
||||
value: searchStr,
|
||||
isInvalid: false,
|
||||
errorMsg: '',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const checkValidated = (): boolean => {
|
||||
|
|
Loading…
Reference in New Issue