File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 18
18
19
19
.graphiql-tab-input {
20
20
all : unset;
21
- padding : var (--px-4 ) 28px var (--px-4 ) var (--px-8 );
22
21
width : 100% ;
22
+ padding : var (--px-4 ) 28px var (--px-4 ) var (--px-8 );
23
23
border-radius : var (--border-radius-8 ) var (--border-radius-8 ) 0 0 ;
24
24
25
25
& : focus {
Original file line number Diff line number Diff line change @@ -250,24 +250,24 @@ const handleTabValueChange: ComponentProps<'input'>['onChange'] = event => {
250
250
} ;
251
251
252
252
const handleTabValueKeyDown : ComponentProps < 'input' > [ 'onKeyDown' ] = event => {
253
- if ( event . key === 'Enter' || event . key === 'Escape' ) {
254
- const input = event . currentTarget ;
253
+ if ( event . key !== 'Enter' && event . key !== 'Escape' ) {
254
+ return ;
255
+ }
256
+ const input = event . currentTarget ;
255
257
256
- if ( ! input . value ) {
257
- input . value = input . defaultValue ;
258
- // @ts -expect-error
259
- handleTabValueChange ( event ) ;
260
- }
261
- input . blur ( ) ;
258
+ if ( ! input . value ) {
259
+ input . value = input . defaultValue ;
260
+ // @ts -expect-error
261
+ handleTabValueChange ( event ) ;
262
262
}
263
+ input . blur ( ) ;
263
264
} ;
264
265
265
266
const handleTabDoubleClickAndBlur = (
266
267
event : MouseEvent < HTMLInputElement > | FocusEvent < HTMLInputElement > ,
267
268
) => {
268
- const isBlur = event . type === 'blur' ;
269
269
const input = event . currentTarget ;
270
- input . readOnly = isBlur ;
270
+ input . readOnly = event . type === 'blur' ;
271
271
} ;
272
272
273
273
export function GraphiQLInterface ( props : GraphiQLInterfaceProps ) {
You can’t perform that action at this time.
0 commit comments