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

Disable Virtual Scrolling in @uiw/react-codemirror #662

Open
smeetagrawal opened this issue Jun 14, 2024 · 1 comment
Open

Disable Virtual Scrolling in @uiw/react-codemirror #662

smeetagrawal opened this issue Jun 14, 2024 · 1 comment

Comments

@smeetagrawal
Copy link

Hello,

I am currently using @uiw/react-codemirror to implement key selection functionality in my project. Upon inspecting the elements in the browser's developer tools, I noticed that virtual scrolling is enabled, which leads to DOM manipulations during user scrolls. Specifically, some div elements are being removed and new ones are added dynamically.

While I understand and appreciate the efficiency that virtual scrolling offers, I would like to know if there is a way to disable this feature. My requirement is to maintain the scroll functionality without the DOM manipulations. Ideally, once the ReactCodeMirror component loads, all the div elements should be rendered at once without any further modifications during scrolling.

Version Details
@uiw/react-codemirror: ^4.22.1

Code Example

<ReactCodeMirror
  value={value}
  height="30vh"
  language="json"
  readOnly
  placeholder="Enter URL and hit send to get a response"
  onChange={onChange}
  extensions={[json()]}
  padding={15}
  style={{
    fontFamily: "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",
    border: "0 !important",
    borderRadius: 12,
  }}
  onClick={handleOnClickApiResponse}
/>

@jaywcjlove
Copy link
Member

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

2 participants