File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,19 @@ const Playground = (props: PlaygroundProps) => {
6262 < div
6363 className = "canvasStyle"
6464 id = "canvas"
65- onClick = { ( ) => props . handleSelect ( null ) }
65+ onClick = { ( event ) => {
66+ console . log ( "canvas clicked" , event ) ;
67+ // reset selected state if clicked outside topbarDialog
68+ if (
69+ ! (
70+ ( event . target as any ) ?. id ?. includes ( "topbarDialog" ) ||
71+ ( event . target as any ) ?. nextElementSibling ?. id ?. includes (
72+ "topbarDialog"
73+ )
74+ )
75+ )
76+ props . handleSelect ( null ) ;
77+ } }
6678 >
6779 < div
6880 id = "statesContainer"
Original file line number Diff line number Diff line change @@ -464,16 +464,19 @@ export const TopBar = (props: TopBarProps) => {
464464 return (
465465 < >
466466 < Dialog
467+ id = "topbarDialog"
467468 open = { isTopbarDialogOpen }
468469 onClose = { ( ) => setIsTopbarDialogOpen ( false ) }
469470 >
470- < DialogTitle >
471+ < DialogTitle id = "topbarDialogTitle" >
471472 { dialogType
472473 ? "Enter new Transition label(s)"
473474 : "Enter New State Name" }
474475 </ DialogTitle >
475- < DialogContent >
476- < DialogContentText > { topbarDialogError } </ DialogContentText >
476+ < DialogContent id = "topbarDialogContent" >
477+ < DialogContentText id = "topbarDialogContentText" >
478+ { topbarDialogError }
479+ </ DialogContentText >
477480 < TextField
478481 autoFocus
479482 margin = "dense"
@@ -482,6 +485,7 @@ export const TopBar = (props: TopBarProps) => {
482485 type = "text"
483486 fullWidth
484487 variant = "standard"
488+ autoComplete = "off"
485489 value = { topbarDialogValue }
486490 onChange = { ( e ) =>
487491 setTopbarDialogValue (
@@ -494,7 +498,7 @@ export const TopBar = (props: TopBarProps) => {
494498 }
495499 />
496500 </ DialogContent >
497- < DialogActions >
501+ < DialogActions id = "topbarDialogActions" >
498502 < Button onClick = { ( ) => setIsTopbarDialogOpen ( false ) } > Cancel</ Button >
499503 < Button
500504 onClick = { ( ) => {
You can’t perform that action at this time.
0 commit comments