Skip to content

Commit f349217

Browse files
Merge pull request #48 from geekychandan/link-modal-bugfix
fix: fix modal state reset
2 parents eb70b7f + 01864e2 commit f349217

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

component/src/components/ui/Dialog.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ const FileUrlDialog = ({ isOpen, onClose, onSubmit, linkText, link, children })
104104
const [text, setText] = useState(linkText || ""); // Initialize with title if provided
105105
const [error, setError] = useState("");
106106

107+
// Reset dialog state after submission
108+
useEffect(() => {
109+
if (isOpen) {
110+
resetToDefault();
111+
}
112+
}, [isOpen, link, linkText]);
113+
107114
const closeDialog = () => {
108115
resetToDefault();
109116
onClose();

0 commit comments

Comments
 (0)