mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Clearing form when closing Tag edit modal.
This commit is contained in:
parent
a5da49a135
commit
e71f17749a
1 changed files with 10 additions and 10 deletions
|
|
@ -4,7 +4,8 @@ import {
|
|||
Button as SButton,
|
||||
Confirm,
|
||||
Dimmer,
|
||||
Divider, Dropdown,
|
||||
Divider,
|
||||
Dropdown,
|
||||
Form,
|
||||
FormInput,
|
||||
Grid,
|
||||
|
|
@ -164,6 +165,13 @@ function EditTagsModal() {
|
|||
const [tagColor, setTagColor] = useState(DEFAULT_TAG_COLOR);
|
||||
const textColor = contrastingColor(tagColor);
|
||||
|
||||
const localOnClose = () => {
|
||||
setOpen(false);
|
||||
setTagName('');
|
||||
setTagColor(null);
|
||||
setTagId(null);
|
||||
}
|
||||
|
||||
const localDeleteTag = async (id, name) => {
|
||||
await deleteTag(id, name);
|
||||
if (fetchTags) {
|
||||
|
|
@ -197,7 +205,7 @@ function EditTagsModal() {
|
|||
<Modal closeIcon
|
||||
open={open}
|
||||
onOpen={() => setOpen(true)}
|
||||
onClose={() => setOpen(false)}
|
||||
onClose={localOnClose}
|
||||
>
|
||||
<Modal.Header>Edit Tags</Modal.Header>
|
||||
<Modal.Content>
|
||||
|
|
@ -389,11 +397,3 @@ export const TagsDropdown = ({value = [], onChange, ...props}) => {
|
|||
{...props}
|
||||
/>
|
||||
}
|
||||
|
||||
export const TagsProvider = ({children}) => {
|
||||
const value = useTagsInterval();
|
||||
|
||||
return <TagsContext.Provider value={value}>
|
||||
{children}
|
||||
</TagsContext.Provider>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue