Not submitting download form when tags button is clicked.

This commit is contained in:
Roland 2023-04-04 16:00:23 -06:00
parent 8874dac5c9
commit 4b81d6ae5e
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -256,6 +256,13 @@ export function AddTagsButton({selectedTagNames = [], onToggle = _.noop, onAdd =
const [loading, setLoading] = React.useState(false);
const [localTags, setLocalTags] = React.useState(selectedTagNames);
const handleOpen = (e) => {
if (e) {
e.preventDefault();
}
setOpen(true);
}
const addTag = (name) => {
setLoading(true);
try {
@ -285,10 +292,10 @@ export function AddTagsButton({selectedTagNames = [], onToggle = _.noop, onAdd =
const unusedTagsGroup = <TagsGroup tagNames={unusedTags} onClick={addTag}/>;
return <>
<SButton icon='tag' onClick={() => setOpen(true)}/>
<SButton icon='tag' onClick={handleOpen}/>
<Modal closeIcon
open={open}
onOpen={() => setOpen(true)}
onOpen={(e) => handleOpen(e)}
onClose={() => setOpen(false)}>
<Modal.Content>
{loading && <Dimmer active><SLoader/></Dimmer>}