Skip to content

Commit 8b56462

Browse files
authored
fix incorrect caret position on Windows (#4046)
* fix incorrect caret position on Windows * try * try * try * try * back to fira code * see if we need font-feature-settings * add changeset * Update .changeset/nervous-comics-happen.md
1 parent ffddb4d commit 8b56462

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@graphiql/react': patch
3+
'graphiql': patch
4+
---
5+
6+
Enable font ligatures in monaco-editors fix incorrect caret position on Windows

packages/graphiql-react/src/utility/create-editor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ export function createEditor(
130130
},
131131
scrollBeyondLastLine: false, // cleans up unnecessary "padding-bottom" on each editor
132132
fontFamily: '"Fira Code"',
133+
// Enable font ligatures and fix incorrect caret position on Windows
134+
// See: https://github.com/graphql/graphiql/issues/4040
135+
fontLigatures: true,
133136
lineNumbersMinChars: 2, // reduce line numbers width on the left size
134-
tabIndex: -1, // Do not allow tabbing into the editor, only via by pressing Enter ot its container
137+
tabIndex: -1, // Do not allow tabbing into the editor, only via by pressing Enter or its container
135138
...options,
136139
});
137140
}

0 commit comments

Comments
 (0)