Skip to content

Make scrollIntoView optional? #54

@chadselph

Description

@chadselph

I'm using codemirror to view/edit a JSON blob that is also bound to a bunch of UI widgets. I wanted to add a feature to edit the JSON directly for cases when the UI hasn't caught up to all the backend functionality but there's kind of this funky behavior that any external updates to the codemirror model cause the page to scroll to it.

For example:

<script setup>
import {ref, computed} from 'vue'
import codemirror from "vue-codemirror6"

const code = ref('some code');
</script>

<template>
  <div style="height: 500px; overflow:scroll">
  <input v-model="code">
  <div style="height: 600px" />
  <codemirror basic v-model="code" />
  </div>
</template>

I think the culprit is probably the use of scrollIntoView as I'm able to reproduce this when using codemirror directly only when I set that flag in the transaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions