Skip to content

Commit

Permalink
update escape key was pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
aBgAmeuR committed Jul 5, 2023
1 parent 574903f commit 7391e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Editor/Bar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PanelTop, Spline } from "lucide-react"
import { useReactFlow } from "reactflow"
import { useEffect } from "react"
import { useEffect, ChangeEvent } from 'react';

export type Bar = {
onCreateNode: (newNode: { type: string; data: any; position: any }) => void
Expand All @@ -12,7 +12,7 @@ export function Bar({ onCreateNode, addEdgeMode, setAddEdgeMode }: Bar) {
const flow = useReactFlow()

useEffect(() => {
const handleKeyDown = (event) => {
const handleKeyDown = (event: ChangeEvent) => {
if (event.keyCode === 27) {
// Escape key was pressed
setAddEdgeMode(false)
Expand Down

0 comments on commit 7391e47

Please sign in to comment.