Skip to content

Commit

Permalink
Prevent edge deletion from triggering form validation
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Oct 19, 2023
1 parent 346d63a commit 896fa97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import React, { useContext } from 'react';
import { useFormikContext } from 'formik';
import {
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -14,7 +13,7 @@ import {
EuiButtonIcon,
} from '@elastic/eui';
import { rfContext } from '../../../store';
import { IComponentData, WorkspaceFormValues } from '../../../component_types';
import { IComponentData } from '../../../component_types';
import { InputHandle } from './input_handle';
import { OutputHandle } from './output_handle';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export function DeletableEdge(props: DeletableEdgeProps) {
className="nodrag nopan"
>
<button
// We need to specify type as "button" to prevent formik from reading this as a "submit" type
// by default, in which case validation is triggered unexpectedly.
type="button"
className="delete-edge-button"
onClick={(event) => onEdgeClick(event, props.id)}
>
Expand Down

0 comments on commit 896fa97

Please sign in to comment.