fix: create new tag set default value

This commit is contained in:
shuai 2022-12-26 14:10:07 +08:00
parent e6a3bb0ed7
commit 3f6253e3c2
2 changed files with 15 additions and 2 deletions

View File

@ -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>

View File

@ -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 => {