@@ -641,7 +641,12 @@ class ArgView extends React.PureComponent<ArgViewProps, ArgViewState> {
641
641
}
642
642
643
643
function isRunShortcut ( event ) {
644
- return event . metaKey && event . key === 'Enter' ;
644
+ return event . ctrlKey && event . key === 'Enter' ;
645
+ }
646
+
647
+ function canRunOperation ( operationName ) {
648
+ // it does not make sense to try to execute a fragment
649
+ return operationName !== 'FragmentDefinition'
645
650
}
646
651
647
652
type AbstractArgViewProps = { |
@@ -708,11 +713,6 @@ class ScalarInput extends React.PureComponent<ScalarInputProps, {}> {
708
713
this . _ref = ref ;
709
714
} }
710
715
type = "text"
711
- onKeyDown = { event => {
712
- if ( isRunShortcut ( event ) ) {
713
- this . props . onRunOperation ( event ) ;
714
- }
715
- } }
716
716
onChange = { this . _handleChange }
717
717
value = { value }
718
718
/>
@@ -1513,7 +1513,7 @@ class RootView extends React.PureComponent<RootViewProps, {}> {
1513
1513
this . props . onOperationRename ( event . target . value ) ;
1514
1514
1515
1515
_handlePotentialRun = event => {
1516
- if ( isRunShortcut ( event ) ) {
1516
+ if ( isRunShortcut ( event ) && canRunOperation ( this . props . definition . kind ) ) {
1517
1517
this . props . onRunOperation ( this . props . name ) ;
1518
1518
}
1519
1519
} ;
@@ -1555,7 +1555,9 @@ class RootView extends React.PureComponent<RootViewProps, {}> {
1555
1555
borderBottom : this . props . isLast ? 'none' : '1px solid #d6d6d6' ,
1556
1556
marginBottom : '0em' ,
1557
1557
paddingBottom : '1em' ,
1558
- } } >
1558
+ } }
1559
+ tabIndex = '0'
1560
+ onKeyDown = { this . _handlePotentialRun } >
1559
1561
< div style = { { color : styleConfig . colors . keyword , paddingBottom : 4 } } >
1560
1562
{ operation } { ' ' }
1561
1563
< span style = { { color : styleConfig . colors . def } } >
0 commit comments