File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,13 @@ const TestAString = (props: TestAStringProps) => {
318318
319319 return (
320320 < >
321- < Dialog open = { props . isTestAStringDialogOpen } onClose = { handleClose } >
321+ < Dialog
322+ open = { props . isTestAStringDialogOpen }
323+ onClose = { handleClose }
324+ onKeyUp = { ( e ) => {
325+ if ( e ?. key === "Enter" ) handleSubmit ( ) ;
326+ } }
327+ >
322328 < DialogTitle > Test a string</ DialogTitle >
323329 < DialogContent >
324330 < DialogContentText >
Original file line number Diff line number Diff line change @@ -428,6 +428,16 @@ export const TopBar = (props: TopBarProps) => {
428428 props . handleSelect ( null ) ;
429429 } ;
430430
431+ const handleTopbarDialogSubmit = ( ) => {
432+ dialogType === 0
433+ ? handleEditStateName ( )
434+ : dialogType === 1
435+ ? handleEditTransitionLabel ( )
436+ : dialogType === 2
437+ ? handleRemoveTransitions ( )
438+ : handleDeleteState ( ) ;
439+ } ;
440+
431441 var returnTopBarAppearance = ( ) => {
432442 let allowedActions : string [ ] = [ ] ;
433443
@@ -472,6 +482,9 @@ export const TopBar = (props: TopBarProps) => {
472482 id = "topbarDialog"
473483 open = { isTopbarDialogOpen }
474484 onClose = { ( ) => setIsTopbarDialogOpen ( false ) }
485+ onKeyUp = { ( e ) => {
486+ if ( e ?. key === "Enter" ) handleTopbarDialogSubmit ( ) ;
487+ } }
475488 >
476489 < DialogTitle id = "topbarDialogTitle" >
477490 { dialogType === 0
@@ -511,19 +524,7 @@ export const TopBar = (props: TopBarProps) => {
511524 ) }
512525 < DialogActions id = "topbarDialogActions" >
513526 < Button onClick = { ( ) => setIsTopbarDialogOpen ( false ) } > Cancel</ Button >
514- < Button
515- onClick = { ( ) => {
516- dialogType === 0
517- ? handleEditStateName ( )
518- : dialogType === 1
519- ? handleEditTransitionLabel ( )
520- : dialogType === 2
521- ? handleRemoveTransitions ( )
522- : handleDeleteState ( ) ;
523- } }
524- >
525- Ok
526- </ Button >
527+ < Button onClick = { handleTopbarDialogSubmit } > Ok</ Button >
527528 </ DialogActions >
528529 </ Dialog >
529530
You can’t perform that action at this time.
0 commit comments