diff --git a/.changeset/nervous-comics-happen.md b/.changeset/nervous-comics-happen.md new file mode 100644 index 0000000000..3e19ce1622 --- /dev/null +++ b/.changeset/nervous-comics-happen.md @@ -0,0 +1,6 @@ +--- +'@graphiql/react': patch +'graphiql': patch +--- + +Enable font ligatures in monaco-editors fix incorrect caret position on Windows diff --git a/packages/graphiql-react/src/utility/create-editor.ts b/packages/graphiql-react/src/utility/create-editor.ts index 7267f00a4d..a19640b871 100644 --- a/packages/graphiql-react/src/utility/create-editor.ts +++ b/packages/graphiql-react/src/utility/create-editor.ts @@ -130,8 +130,11 @@ export function createEditor( }, scrollBeyondLastLine: false, // cleans up unnecessary "padding-bottom" on each editor fontFamily: '"Fira Code"', + // Enable font ligatures and fix incorrect caret position on Windows + // See: https://github.com/graphql/graphiql/issues/4040 + fontLigatures: true, lineNumbersMinChars: 2, // reduce line numbers width on the left size - tabIndex: -1, // Do not allow tabbing into the editor, only via by pressing Enter ot its container + tabIndex: -1, // Do not allow tabbing into the editor, only via by pressing Enter or its container ...options, }); }