mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Fix SQL query editor cursor alignment issue (#28878)
for #27233 # Checklist for submitter - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. ## Details This PR fixes an issue where the cursor in the SQL editor would become misaligned under some circumstances. I was never able to reproduce this personally, but big thanks to @mason-buettner for both the reproduction and testing this fix. The issue seems to stem from the Ace editor having a hard time dealing with CSS scaling. I'm not sure what circumstances actually cause this to occur, but a combination of Google and ChatGPT lead me to https://github.com/securingsincity/react-ace/issues/750 and https://github.com/ajaxorg/ace/issues/4794 which I combined for this fix which seems to work.
This commit is contained in:
parent
f6da8ee67b
commit
28ba274f1f
3 changed files with 9 additions and 1 deletions
1
changes/27233-fix-cursor-alignment-issue
Normal file
1
changes/27233-fix-cursor-alignment-issue
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Fixed an issue where the cursor on the SQL editor would sometimes become misaliged
|
||||
|
|
@ -280,7 +280,7 @@ const SQLEditor = ({
|
|||
onBlur={onBlurHandler}
|
||||
onLoad={onLoadHandler}
|
||||
readOnly={readOnly}
|
||||
setOptions={{ enableLinking: true }}
|
||||
setOptions={{ enableLinking: true, hasCssTransforms: true }}
|
||||
showGutter={showGutter}
|
||||
showPrintMargin={false}
|
||||
theme="fleet"
|
||||
|
|
|
|||
|
|
@ -53,3 +53,10 @@
|
|||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sql-editor,
|
||||
.sql-editor * {
|
||||
letter-spacing: normal !important;
|
||||
word-spacing: normal !important;
|
||||
font-family: 'SourceCodePro', monospace !important;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue