Skip to content

Commit 4ed7cda

Browse files
committed
fix lint
1 parent 8247a4c commit 4ed7cda

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

packages/graphiql-react/src/ui/tabs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
.graphiql-tab-input {
2020
all: unset;
21-
padding: var(--px-4) 28px var(--px-4) var(--px-8);
2221
width: 100%;
22+
padding: var(--px-4) 28px var(--px-4) var(--px-8);
2323
border-radius: var(--border-radius-8) var(--border-radius-8) 0 0;
2424

2525
&:focus {

packages/graphiql/src/components/GraphiQL.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,24 +250,24 @@ const handleTabValueChange: ComponentProps<'input'>['onChange'] = event => {
250250
};
251251

252252
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;
255257

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);
262262
}
263+
input.blur();
263264
};
264265

265266
const handleTabDoubleClickAndBlur = (
266267
event: MouseEvent<HTMLInputElement> | FocusEvent<HTMLInputElement>,
267268
) => {
268-
const isBlur = event.type === 'blur';
269269
const input = event.currentTarget;
270-
input.readOnly = isBlur;
270+
input.readOnly = event.type === 'blur';
271271
};
272272

273273
export function GraphiQLInterface(props: GraphiQLInterfaceProps) {

0 commit comments

Comments
 (0)