-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Vertical Scrollbar moves always to the middle #215
Comments
I have the same issue, as a workaround I scroll to the top when I handle the ready event
|
ngseke
added a commit
to ngseke/taiwan-company-blocker
that referenced
this issue
Dec 16, 2023
Not sure why, but it seems For example: <script setup>
import { ref } from 'vue'
import { Codemirror } from 'vue-codemirror'
const text = ref()
// Simulate a asynchronous request
setTimeout(() => {
text.value = 'multiple lines\n'.repeat(100)
}, 500)
</script>
<template>
<Codemirror
v-if="text"
:modelValue="text"
:style="{ height: '300px' }"
/>
</template> After removing <template>
<Codemirror
- v-if="text"
:modelValue="text"
:style="{ height: '300px' }"
/>
</template> |
I am using this version as scrollintoview was effecting my page const handleReady = () => {
const cm = document.querySelector('.cm-activeLine')
if (cm?.scrollTop){
cm.scrollTop = 0;
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hello,
we have xmls/ other file contents with many lines which exceeds the screen size limit, we have to scroll. Since auto scroll is not configured in codemirror , we set the height to a fixed value. The scroll bar appears. But whenever i access a content, which exceeds the screen size the scrollbar allways moves to the middle. See the code in reproduction section.
Expected behaviour: The scrollbar begins at the top or at least it is configurable.
Screen resolution:
Thanks and best regards
Andreas
Reproduction
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: