Skip to content

Commit

Permalink
dynamicForm: prevent page refresh on form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamNowotny committed Sep 11, 2024
1 parent 10f5801 commit 2350a74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/options/pages/service/components/dynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default ({
[];
const [isLoading, setIsLoading] = useState<boolean>(false);

const handleShow = () => {
const handleShow = e => {
setIsLoading(true);
core.availableProjects(updatedService, ({ pipelines, error }) => {
setIsLoading(false);
Expand All @@ -47,6 +47,7 @@ export default ({
if (onShow) onShow(pipelines, updatedService);
}
});
e.preventDefault();
};
const handleSave = () => {
if (onSave) onSave(updatedService);
Expand Down

0 comments on commit 2350a74

Please sign in to comment.