Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(react): button not working as submit
Elian Doran164feaa3ec64
diff --git a/apps/client/src/widgets/react/Button.tsx b/apps/client/src/widgets/react/Button.tsxindex 2dbceafa00..1fa8822acc 100644--- a/apps/client/src/widgets/react/Button.tsx+++ b/apps/client/src/widgets/react/Button.tsx@@ -4,6 +4,7 @@ interface ButtonProps {text: string;className?: string;keyboardShortcut?: string;+ /** Called when the button is clicked. If not set, the button will submit the form (if any). */onClick?: () => void;}@@ -20,7 +21,7 @@ export default function Button({ className, text, onClick, keyboardShortcut }: Breturn (<buttonclassName={classes.join(" ")}- type="button"+ type={onClick ? "button" : "submit"}onClick={onClick}ref={buttonRef}>