Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caret (text cursor) offset is not sticking to the end of the line #2083

Open
shaibam opened this issue Dec 15, 2024 · 1 comment
Open

Caret (text cursor) offset is not sticking to the end of the line #2083

shaibam opened this issue Dec 15, 2024 · 1 comment

Comments

@shaibam
Copy link

shaibam commented Dec 15, 2024

Problem

When typing in the code the Caret offsetX grows and moves far away from the end of the line.
My code is very basic

Sample code to reproduce your issue

import AceEditor from 'react-ace';

import 'ace-builds/src-noconflict/ext-language_tools';
import 'ace-builds/src-min-noconflict/mode-mysql';
import 'ace-builds/src-noconflict/theme-sqlserver';

export default function QueryEditor({ value, onChange = () => {} }) {
  return (
    <div>
      <AceEditor
        id="editor"
        aria-label="editor"
        mode="mysql"
        theme="sqlserver"
        name="editor"
        width="100%"
        fontSize={14}
        lineHeight={19}
        minLines={15}
        maxLines={10}
        showPrintMargin
        showGutter
        highlightActiveLine
        placeholder="Write your query here..."
        editorProps={{ $blockScrolling: true }}
        setOptions={{
          enableBasicAutocompletion: true,
          enableLiveAutocompletion: true,
          enableSnippets: false,
          enableMobileMenu: true,
          showLineNumbers: true,
          tabSize: 2
        }}
        value={value}
        onChange={onChange}
        showLineNumbers
      />
    </div>
  );
}

References

caret.mp4

Progress on: #

@shaibam
Copy link
Author

shaibam commented Dec 15, 2024

This seems to help (css)

  * {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro',
      monospace !important;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant