mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
Not submitting download form when tags button is clicked.
This commit is contained in:
parent
8874dac5c9
commit
4b81d6ae5e
1 changed files with 9 additions and 2 deletions
|
|
@ -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>}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue