-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Unable to use browser's selection API when text in the editor is long enough #637
Comments
@OmriGLevy This is the CodeMirror lazy loading feature, providing a smooth user experience for loading lengthy text. |
Indeed the virtualisation of the full text is helpful for smoother experience, but when we use the Selection API we do not want to get truncated output. |
@OmriGLevy You can use CodeMirror's selection plugin to address this issue. |
When passing long enough text to the CodeMirror component, it will only create certain DOM elements based on the height of the CodeMirror component, therefore, when the text is too long, using the browser’s Selection API will be impossible since the actual selection will be the virtualized version of the text, and therefore the selection will be truncated.
My text is 355 lines long, and contains 18,238 characters. The CodeMirror component wraps the a text area element, the element does contain the full text , I am using "@uiw/react-codemirror": “^4.21.21”.
I could did not find anything in the documentation regarding the pattern. when the text is not long everything works fine.
The text was updated successfully, but these errors were encountered: